Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Regarding Useful Yum Commands

Dude!Apr 26 2017 — edited May 4 2017

Regarding , I just wanted to add my 2 cents...

Sometimes Oracle updates it's distribution packages, then existing metadata may no longer be valid, resulting in a typical error message like:

http://yum.oracle.com/repo/OracleLinux/OL7/UEKR4/x86_64/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum

In such case, simply clearing the local yum caches should fix the problem:

# yum clean all

Loaded plugins: ulninfo

Cleaning repos: ol7_UEKR4 ol7_latest

Cleaning up everything

One of the yum commands I use most often beside the usual install and update is provides. I use it to find out which package contains a certain file, or which package installed a certain file. I also use this command to find out if a certain file is available. I often know the file or command, but not the name of the package that installs it. The search argument only searches in package descriptions, but does not include filenames.

For example:

# yum --enablerepo=ol7_optional_latest provides "*/uuencode"

Loaded plugins: ulninfo

sharutils-4.13.3-8.el7.x86_64 : The GNU shar utilities for packaging and

                              : unpackaging shell archives

Repo        : ol7_optional_latest

Matched from:

Filename    : /usr/bin/uuencode

According to the above: /usr/bin/uuencode is installed by the sharutils package, available in the ol7_optional_latest repository (Public Yum).

Using the --enablerepo= argument, I can temporarily enable a repository without making any changes to the current yum setup. It is also possible to use "--enablerepo=*" to temporarily enable all repository lists in any of the configurations in /etc/yum.d, but this would arguably be a last resort - and not something you would try in OL release 5, since this can take a very long time. Btw, as a general rule, when specifying wildcards as arguments, it is essential to use quotes, otherwise file globbing by shell interpreter will kick in. If you don't know what I mean, simply try echo "*" and echo * to see the difference.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2017
Added on Apr 26 2017
7 comments
801 views