Some command examples of how to use YUM

how to use yum
Most Linux distros provide a package manager. Debian and its derivatives use apt-get, Arch Linux uses pacman and Fedora uses YUM. YUM stands for "Yellowdog Updater Modified" and just like the other package managers of the other distros, you can use YUM for installing, removing, updating packages ...

In today's article, I will show you some command examples of how to use YUM. This may be helpful for you if you are using Fuduntu, a derivative of Fedora, like me.

1. Install a package

The command to install a package with yum is just like with apt-get:
 yum install packagename  
You will need root access to run this command. After you hit enter, yum will ask you to confirm if you really want to this package. If you want to bypass this asking, you can use the option "-y":
 yum -y install packagename  

2. Uninstall a package

To uninstall a package with yum, the command is:
 yum remove packagename  
And just like with the install command, you will be asked to confirm if you really want to remove the package.

3. Search for a package to install

In case you dont remember the exact name of the package, you can use the following command to search for all the packages that matches the keyword and display it
 yum search keyword  

The keyword just needs to be a part of the package name. How long the search process takes and how many packages will be shown after the search depend on the keyword. The more specific the keyword is, the faster the search process will take and the search output will have less packages.

4. Display additional information about a package

If you want to view additional information about a package, you can use the following command:
 yum info packagename  

This command will give you a brief list of the description, the current version, the architecture, the size, licenses ... of the packag.

5. Check the installed packages

To get a list of the installed packages on your system, you can use this command:
 yum list installed | less  

6. Check the packages which a file belongs to

If you like to know which package a particular file belongs to, you can use this command:
 yum provides /path/to/file  
linux tips and tricks