Some pretty useful YUM tips & tricks

Yum is the default package manager for RPM packages on RHEL & CentOS. And most of you working on these OS should be familiar with it (for those of you who are not, read our article Working with Yum Commands ). In this article, we are going to discuss some Yum tips & tricks that we normally don’t know or use but are pretty useful.

So let’s start …

Downgrade a package

You might have come across this issue or might run into someday, where you have upgraded a package that was not meant to be upgraded or you have upgraded a package with good intentions but its causing you some trouble. With YUM , we have option to downgrade a package to the previous version, just open your terminal & execute the following command,

$ yum downgrade package_name

yum tips

( Also Read : 5 ways to change HOSTNAME in RHEL/CentOS 7 )

 

Yum shell

This yum tip is actually known to pretty few. We can actually start a Yum Shell & use it to manage packages. To start the yum shell, open terminal & type

$ yum shell

Now shell for yum will be started & we can run all the shell command minus the yum at the beginning. For example ‘search package_name’

yum tips

 

Install only security updates

To actually do this, we need to install a plugin called ‘yum-plugin-security’. We don’t need to install this plugin on RHEL 7, as it’s already part of yum. To install the plugin on RHEL 6 , execute the following command,

$ yum install yum-plugin-security

Once plugin has bee installed, we can check the list of errates by executing the following command,

$ yum updateinfo list available

yum tips

To check all available security updates, run

$ yum updateinfo list security all
$ yum updateinfo list sec

To install only the errata updates, run

$ yum update-minimal –security -y

To download & apply all the security updates, run

$ yum update –security -y

 

Check when package was installed/updated

Though technically it’s not one of the yum tips but rather a RPM one but none the less, it’s pretty useful & comes handy at times. We can check when a package has been installed or when its was last update by running the following command,

$ rpm -qa –last

yum tips

To know when a particular package has been installed, execute the following command,

$ rpm -q package_name –last

These were some yum tips & tricks (& one rpm trick) to help you out. Please send in your suggestions or queries to us using the comment box below, we will surely address them.

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of you hard earned money:

Linux TechLab is thankful for your continued support.

Shusain

Passionate about Linux & open source. Loves to learn, read & write about Linux as well as new technologies.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *