Avatar of marrowyung
marrowyung
 asked on

yum and dnf update failed

hi,

my CentOS linux VM on my hyper-V seems having trouble on running yum -y update and dnf -y update once the machine stop from power outstage, it seems saying my account do not have the right to run it but I am using root to login!

yum failed with this error message:

yum failed
and dnf failed with similar error:

dnf failed
how to solve both problem ?
LinuxVirtualizationHyper-V

Avatar of undefined
Last Comment
marrowyung

8/22/2022 - Mon
Seth Simmons

how to solve both problem ?

there is only 1 problem
yum was replaced with dnf; running yum just points to dnf so you're running the same thing

are you using any custom repo or just the default?
did you try dnf clean all then try to update again?
could be some corrupt info from the power outage
marrowyung

ASKER
yum was replaced with dnf; running yum just points to dnf so you're running the same thing
\
ok, what good is dnf than yum ?

are you using any custom repo or just the default?

default , anyway to verify it ?

did you try dnf clean all then try to update again?

tried both dnf clean packages and dnf clean all , still the same thing!

yum update failed
could be some corrupt info from the power outage

any command can ask Centos to find it out and fix it accordingly ?

I also found CentOS apps update page has this:

software updates failes
Seth Simmons

ok, what good is dnf than yum ?

https://en.wikipedia.org/wiki/DNF_(software)

default , anyway to verify it ?

if you haven't edited the repo list manually then i wouldn't worry about that


any command can ask Centos to find it out and fix it accordingly ?

rename the cache folder
mv /var/cache/dnf /var/cache/dnf-old
try dnf update again
Your help has saved me hundreds of hours of internet surfing.
fblack61
marrowyung

ASKER
rename the cache folder
mv /var/cache/dnf /var/cache/dnf-old
try dnf update again

this seems this kind of dnf problem will happen quite reqularily ?

and how to solve the app store problem?

mv /var/cache/dnf /var/cache/dnf-old
try dnf update again

more dnf cachemove-dnf-cache.jpg
marrowyung

ASKER
mv /var/cache/dnf /var/cache/dnf-old
try dnf update again

still can't !


and for the CentOS app store for any system update I can't download and the error is :

app store
I tried to yum the package I highlight and the download of package doesn't work.
same cache message!
Joe Woodhouse

What is the output of running

dnf repolist
cat /etc/yum/pluginconf.d/product-id.conf 
cat /etc/yum/pluginconf.d/subscription-manager.conf

Open in new window


?

If you have "enabled=1" in either of those files, edit them to make it "enabled=0" instead.

Suggest you also repeat renaming the cache folder and once you've done that, run "dnf clean all" again.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
marrowyung

ASKER
dnf repolist

dnf repolist
cat /etc/yum/pluginconf.d/product-id.conf
cat /etc/yum/pluginconf.d/subscription-manager.conf


no such file
Joe Woodhouse

Hm, ok.

Did you rename the cache folder and then run "dnf clean all" again?

If you've done that and it's still not working then I'll have to look into this some more tomorrow as I'm out of ideas.
marrowyung

ASKER
Did you rename the cache folder and then run "dnf clean all" again?

yes

If you've done that and it's still not working then I'll have to look into this some more tomorrow as I'm out of ideas.

tks.

is it CentOS problem ?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
marrowyung

ASKER
do you see what the error message on the GUI when I go to apps store? is it means anything to you ?
Joe Woodhouse

No. My CentOS VM has never had this problem in over a year of frequent use.

I think you damaged something with improper shutdowns during power loss. Most of the suggestions that have been made in this thread are attempts to repair the yum/dnf systems.

Because both yum and dnf cache things separately I think you need to remove both caches and clean both of them:

rm /var/cache/dnf
rm /var/cache/yum
yum clean all
dnf clean all

Do all those and try again. If you're still getting errors then the next step is a full rpm rebuild which is a bit complicated. :)
Joe Woodhouse

Let's get the command line working first and then see if there are still any GUI issues.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
marrowyung

ASKER
rm /var/cache/dnf
rm /var/cache/yum

no such  directory.
marrowyung

ASKER
dnf update

dnf update
marrowyung

ASKER
seems can't remove that package:

can't remove package
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Joe Woodhouse

Yeah that looks like you've pulled down only some of what you need. Normally that happens when someone just copies a repo and tries to install from that, but from your repolist earlier you're picking up all the centos repos correctly.

At this point it looks like an issue with that rpm specifically - your yum/dnf is doing exactly what it should when it finds a repo in module format without everything it needs to install the module.

You'll need someone smarter than I am to fix this one, sorry.
marrowyung

ASKER
No. My CentOS VM has never had this problem in over a year of frequent use.

what CentOS version it is ?
Joe Woodhouse

I update it regularly, currently CentOS release 7.8.2003 (Core), with kernel 3.10.0-1127.el7.x86_64 #1 SMP from 31 March 2020.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
marrowyung

ASKER
CentOS release 7.8.2003 (Core),


centOS 7 ?

I am using CentOS 8, I tried to download another ISO and testing it ! and it seems ISO different but I am now having the same problem.
marrowyung

ASKER
rm /var/cache/dnf
rm /var/cache/yum

I am using CentOS8 and that's why only you got this !

I am using CentOS7 now and it seems the apps store working well
marrowyung

ASKER
now one problem, can't run xclock and xeye but Xwindows system installed, why is it
??
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Joe Woodhouse

New problem = new question :)
marrowyung

ASKER
ok. I fixed myself, the method of enabling xwindows for CentOS 8 and 7 is very different.
ASKER CERTIFIED SOLUTION
marrowyung

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.