Skip to content


How to fix Yum when it hangs at “Setting up Package Sacks”

When installing Fedora 12 today (installing a new copy after troubles during the upgrade from Fedora 11), I got problems with yum, which tended to hang without any error message. I killed it (“kill” failed and I had to use “kill -9”, which worked), cleaned it (yum clean all), rebuilt the RPM database (I don’t even remember this command, sth like rpm -rebuild, and I found out later that this might be quite risky, apparently), manually deleted some RPM data files, and also ran my yum commands in verbose mode. All I could get was yum hanging at “Setting up Package Sacks”, or after what I thought was the end of downloading repository summaries. Anyway, I was just being impatient: after letting it run in the background for maybe 5 minutes, I got an error message saying that a repo (rpmfusion, which I used for VLC) timed out…

Could not retrieve mirrorlist http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-12&arch=x86_64 error was
12: Timeout on http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-12&arch=x86_64: (28, ”)
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmfusion-free. Please verify its path and try again

The fix is simple: remove the faulty repo (what I did was I uninstalled the faulty repo and reinstalled a working copy – more precisely, I removed the repo manually from /etc/yum.repos.d/ then found out I should uninstall them properly with rpm -e rpmfusion-free-release-10-5.noarch). And to make sure this trap won’t ever catch me again, I dramatically decreased the timeout delay for yum, from the default 30 seconds to just 1: edit /etc/yum.conf and add timeout=1.

Other sources:
how to remove repository?
How to fix a yum when it hangs with no error messages

Bonus: a pretty long console log of me trying to install VLC, then messing with the rpm database and yum. I read somewhere that this rebuilding stuff is risky, so beware… yet my Fedora is fine now, despite all I did to hurt it! 🙂 Noobs like me may find useful commands, confirmed users will probably have some fun 😀 Note how miserably a the standard kills fail, while kill -9 is good.

[david@dodora12 ~]$ su
Password:
[root@dodora12 david]# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
Retrieving http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
warning: /var/tmp/rpm-tmp.vwxnDR: Header V3 DSA signature: NOKEY, key ID 49c8885a
Preparing… ########################################### [100%]
1:rpmfusion-free-release ########################################### [100%]
[root@dodora12 david]# yum install vlc
Loaded plugins: presto, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2331.
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: PackageKit
Memory : 22 M RSS (317 MB VSZ)
Started: Sat Dec 19 18:21:01 2009 – 00:26 ago
State : Sleeping, pid: 2331
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: PackageKit
Memory : 22 M RSS (317 MB VSZ)
Started: Sat Dec 19 18:21:01 2009 – 00:28 ago
State : Sleeping, pid: 2331
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: PackageKit
Memory : 22 M RSS (317 MB VSZ)
Started: Sat Dec 19 18:21:01 2009 – 00:30 ago
State : Sleeping, pid: 2331
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: PackageKit
Memory : 22 M RSS (317 MB VSZ)
Started: Sat Dec 19 18:21:01 2009 – 00:32 ago
State : Sleeping, pid: 2331
^C

Exiting on user cancel.
[root@dodora12 david]# yum install vlc
Loaded plugins: presto, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2331.
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: PackageKit
Memory : 22 M RSS (317 MB VSZ)
Started: Sat Dec 19 18:21:01 2009 – 00:47 ago
State : Sleeping, pid: 2331
^C

Exiting on user cancel.
[root@dodora12 david]# kill 2331
[root@dodora12 david]# kill 2331
bash: kill: (2331) – No such process
[root@dodora12 david]# yum install vlc
Loaded plugins: presto, refresh-packagekit
^C^Z
[1]+ Stopped yum install vlc
[root@dodora12 david]# yum install vlc -v
Not loading “blacklist” plugin, as it is disabled
Loading “presto” plugin
Loading “refresh-packagekit” plugin
Not loading “whiteout” plugin, as it is disabled
Config time: 0.057
Yum Version: 3.2.25
Existing lock /var/run/yum.pid: another copy is running as pid 2334.
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: yum
Memory : 22 M RSS (323 MB VSZ)
Started: Sat Dec 19 18:21:56 2009 – 00:25 ago
State : Traced/Stopped, pid: 2334
^C

Exiting on user cancel.
[root@dodora12 david]# kill 2334
[root@dodora12 david]#
[root@dodora12 david]# kill 2334
[root@dodora12 david]# kill -9 2334
[root@dodora12 david]# kill -9 2334
bash: kill: (2334) – No such process
[1]+ Killed yum install vlc
[root@dodora12 david]# yum install vlc -v
Not loading “blacklist” plugin, as it is disabled
Loading “presto” plugin
Loading “refresh-packagekit” plugin
Not loading “whiteout” plugin, as it is disabled
Config time: 0.065
Yum Version: 3.2.25
Setting up Package Sacks
^C^Z
[1]+ Stopped yum install vlc -v
[root@dodora12 david]# yum clean all
Loaded plugins: presto, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2336.
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: yum
Memory : 22 M RSS (323 MB VSZ)
Started: Sat Dec 19 18:22:35 2009 – 00:13 ago
State : Traced/Stopped, pid: 2336
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: yum
Memory : 22 M RSS (323 MB VSZ)
Started: Sat Dec 19 18:22:35 2009 – 00:15 ago
State : Traced/Stopped, pid: 2336
^Z
[2]+ Stopped yum clean all
[root@dodora12 david]# kill -9 2336
[root@dodora12 david]# kill -9 2336
bash: kill: (2336) – No such process
[1]- Killed yum install vlc -v
[root@dodora12 david]# yum clean all
Loaded plugins: presto, refresh-packagekit
Cleaning up Everything
[root@dodora12 david]# yum install vlc
Loaded plugins: presto, refresh-packagekit
fedora/metalink | 28 kB 00:00
fedora | 4.2 kB 00:00
fedora/primary_db | 12 MB 00:11
^Z
[3]+ Stopped yum install vlc
[root@dodora12 david]# yum clean all
Loaded plugins: presto, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2339.
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: yum
Memory : 23 M RSS (326 MB VSZ)
Started: Sat Dec 19 18:23:02 2009 – 02:01 ago
State : Traced/Stopped, pid: 2339
^Z
[4]+ Stopped yum clean all
[root@dodora12 david]# kill -9 2339
[root@dodora12 david]# yum clean all
Loaded plugins: presto, refresh-packagekit
Cleaning up Everything
[3]- Killed yum install vlc
[root@dodora12 david]# cd /var/lib/rpm
[root@dodora12 rpm]# ls
Basenames __db.003 Installtid Provideversion Sigmd5
Conflictname __db.004 Name Pubkeys Triggername
__db.000 Dirnames Obsoletename Requirename
__db.001 Filedigests Packages Requireversion
__db.002 Group Providename Sha1header
[root@dodora12 rpm]# rm __db*
rm: remove regular empty file `__db.000′? y
rm: remove regular file `__db.001′? y
rm: remove regular file `__db.002′? y
rm: remove regular file `__db.003′? y
rm: remove regular file `__db.004′? y
[root@dodora12 rpm]# yum clean all
Loaded plugins: presto, refresh-packagekit
Cleaning up Everything
[root@dodora12 rpm]# yum clean all
Loaded plugins: presto, refresh-packagekit
Cleaning up Everything
[root@dodora12 rpm]# rpm –rebuilddb
[root@dodora12 rpm]# yum clean all
Loaded plugins: presto, refresh-packagekit
Cleaning up Everything
[root@dodora12 rpm]# yum update
Loaded plugins: presto, refresh-packagekit
fedora/metalink | 28 kB 00:00
fedora | 4.2 kB 00:00
fedora/primary_db | 12 MB 00:10
Could not retrieve mirrorlist http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-12&arch=x86_64 error was
12: Timeout on http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-12&arch=x86_64: (28, ”)
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmfusion-free. Please verify its path and try again
[root@dodora12 rpm]#

Posted in Linux.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA