9

I created repository for RHEL 5.6. There was already an existing repository for RHEL 5.2 which I deleted.

I ran the following commands:

yum clean all

yum clean metadata

then,

yum list all

It list all the packages.

But when I type YUM UPDATE. It shows

Setting up Update Process
Setting up repositories
rhel-local                100% |=========================|  951 B    00:0
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 1.1 MB    00:0
################################################## 3229/3229
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files

And that's all folks. There is no further response from YUM UPDATE.

Any idea why yum is getting stuck?

1
  • 1
    you could try to check with strace to see if it is actually doing something.
    – BitsOfNix
    May 25, 2013 at 15:08

4 Answers 4

11

You could also rebuilt the RPM database.

yum clean all
rpm --rebuilddb
1
  • 1
    Run across this problem before, the above fixed it.
    – laebshade
    May 31, 2013 at 4:36
10

In my case I had a RPM db lock that was getting the yum stuck.

Running strace yum --verbose --noplugins info would get stuck at:

open("/var/lib/rpm/.dbenv.lock", O_RDWR|O_CREAT, 0644) = 5
umask(022)                              = 022
fcntl(5, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0,  len=0}Killed

so to fix it I ran as root:

rm /var/lib/rpm/.dbenv.lock
2
  • 1
    ahah: problem is if you don't have strace installed and you can't install because yum is not working (in my case even rpm is broken)
    – maxadamo
    Aug 8, 2019 at 7:48
  • this helped for me. In my case it wasn't really stuck but you couldn't tell until you used strace. it looked like it was stuck on updating kernel-debug-devel, turns out it just has a lot to do! Jan 16, 2022 at 18:34
4

This can typically occur if there is either another yum process already running or the meta data that yum maintains on the system has gotten corrupt.

For the first issue, I usually kill any existing yum processes and then run this command yum-complete-transaction, which should allow yum to clean yup after itself.

For the second issue, I usually have to run a yum clean all to expunge any meta data cruft and packages and then run a yum update as normal.

Occasionally I've also run this command, package-cleanup <options> to clean up different issues with the RPM database:

  • clean up any duplicate packages (Scan for duplicates in the local RPM database and clean out the older versions)

    package-cleanup --cleandupes
    
  • scan for problems (List dependency problems in the local RPM database. If any problems are found it will exit with an exit code of 1)

    package-cleanup --problems
    
  • List orphans. (List installed packages which are not available from currenly configured repositories. This is identical to yum list extras, which may provide better output)

    package-cleanup --orphans
    
1
  • Thanks for the help Actually it I waited for some time for YUM to run. And after 10 mins it started working. I will use your advice on another server and will let your know.
    – OmiPenguin
    Jun 1, 2013 at 7:26
0

I discovered iscsi error messages in /var/log/messages. And then I stopped iscsi and iscid daemons. After that yum completed the update process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .