What is the yum command & how to use it?

The yum is the command in Linux and Unix-like operating systems. YUM stands for Yellowdog Updater Modified. Also, the yum is an updated version of the yup (Yellowdog UPdater) command.

It gives the user effortlessly install, delete, update, search and manage software packages from officially Red Hat software repositories and third-party repositories. It resolves the dependencies while installing the software. The yum command has been started using Red Hat version 5 and later versions.

The yum command was developed by Seth Vidal and Michael Stenner under GPL (General Public License) as an open-source. It means anyone can view the source code and modify it as per their requirements.

The yum allows for automatic updates packages and dependency management on RPM-based distributions.

How to get help for the yum command

I always suggest reading the manual page and help. It will give you an in-depth introduction to the command.

To get the manual page type the below command,

man yum

But, to get the only command options, you can type the below command.

yum --help

Syntax of the yum command

Now you know how to get help with the yum command. So, let’s talk about yum syntax. The syntax of the yum command is as below,

yum [options] <command> [<args>…]

Check all the repository list

This will list the package name from the repository.

yum list

List all available packages

This command will list all the available package names.

yum list available

List all installed packages

This command will list all the installed package names.

yum list installed 

List installed and available kernel packages

This command will list the installed kernel and it will also list if any updated kernel version is available.

yum list kernel
yum command in Linux
Listing installed kernel and available.

Searching a package 

Sometimes we don’t know the package name. So, if this is the case then yum allows us to search the package.

yum search package_name

For example, If you want to search ssh then just type yum search ssh and you will get a bunch of lists for ssh related names.

yum command
Searching for ssh packages

Installing a package with yum command

So, if you are want to install a software package then you can find the below command useful.

yum install package_name

Note: It will ask your permission so only type for yes and for no.

For example, I am installing a network tools package. So the command will be yum install net-tools

yum command
Installing net-tools.

Removing a package

If you want to remove any program which is installed on your server. So, you can use the below command for that.

yum remove package_name

Note: It will ask your permission so only type for yes and for no.

Update a package using yum command

This command will help you to update the package.

yum update package_name

For example, if you want to update the mysql package then the command will be yum -y update mysql

Installation of a group package using yum

So, if you want to install a group of packages in that case you can use the below command.

yum groups mark install package_name

Conclusion

In conclusion, you learned about yum. Which is very powerful to install, remove, update, and manage the packages. It is straightforward, as you can see. Just go through it and try to install, remove, and update. You can play with command. And also go through the manual page and help section. So, I hope, you understand, but if you have any questions, you can ask in the comment section.

Also, you can read about The hostnamectl command in Linux with examples

One comment

Leave a Reply

Your email address will not be published.