yum update experience - the most reliable way
I realized that sometimes the yum tool does not offer all new package versions being available for upgrade when running sudo yum update.
So I tried several methods to optimize the upgrade process and thought, it can be a good idea to share the one with the highest success rate.
It is recommended to perform every update and upgrade action from a virtual console by pressing Ctrl+Alt+F3 after booting on login screen.
It turned out that rebuilding the package cache from scratch by executing sudo yum clean all and sudo yum update is an advantage.
Even though it is not necessary ... after successfully upgrading the packages I always reboot the system to restart all processes and services.
The benefit : a perfectly stable running operating system ! I am curious to know if there are alternative ways to achieve the same reliability ?
Responses
The yum package management tool maintains a cache of its metadata to improve response time and reduce network traffic. By default the metadata will expire after 6 hours (see "man yum.conf"). This can result in a situation where a package has been updated in a repository, but yum's metadata refers to an older version of the package.
To update packages, ensuring that the very latest metadata is current, you can use the following command:
yum update --refresh
Your other suggestions are also good, thank you.
Christian,
Apologies. I stupidly gave you instructions applicable only to Fedora 23 and later.
For Red Hat Enterprise Linux, I recommend the following command:
sudo yum clean expire-cache && sudo yum update
This is actually two commands, with the && between them. The && syntax is specific to Bash and runs the second command only if the first command returns a non-zero state. In other words, the second command is run only if the first is successful.
The yum clean expire-cache removes yum's record of when metadata was downloaded , so the next time yum is run, it will download the repositories' metadata again. The yum clean all method will achieve the same result, but the yum clean expire-cache method is slightly faster and in almost all cases achieves the same result.
The command yum clean expire-cache is faster because it it just one of the tasks that yum clean can be told to do:
yum clean expire-cache
yum clean packages
yum clean headers
yum clean metadata
yum clean dbcache
yum clean rpmdb
yum clean plugins
If you read the man page for yum, you will see:
yum clean all
Does all of the above.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
