Friday, 16 January 2009

RHN's yum update fails

I've noticed that quite often Red Hat's yum will fail for no good reason. For example it will just show an error like:

# yum update

Error Downloading Packages:

samba-common - 3.0.28-1.el5_2.1.x86_64: failed to retrieve getPackage/samba-common-3.0.28-1.el5_2.1.x86_64.rpm from rhel-x86_64-server-5
error was [Errno 14] HTTP Error 404: Not Found

When that's the case, retrying a few times usually does the trick.

I have actually opened a ticket with RHN's support and they've told me these are "temporary errors". Temporary or not they are pretty annoying so here's what I do.

1. Retry manually until you're happy with the list of packages that will be updated
2. Run yum in a while loop so that it retries until it succeeds:

# while ! (yum update -y) ; do echo TRY AGAIN; done

Be aware that if that too many retries can cause your RHN subscription to be temporarily locked-out. I find the benefit too great to care.

1 comment:

Quin said...

I prefer to use "sleep 120" instead of what you've used: echo TRY AGAIN. Might help your hammering problems too.