The yum and dnf package managers are used to install packages or software on your RedHat-based Linux distributions like Rocky Linux. Moreover, the ‘yum’ command checks security updates and binary package information. This article will explore different uses of the yum command in Rocky Linux 8 and Rocky Linux 9.
Open the terminal and log in as the root user through the terminal.
Now, you can use the yum command for the following purposes on your system:
You can display a new list of security and system updates using the' yum' package manager. Type the following command to perform this action:
$ yum list updates
The ‘yum’ command discovers new updates for already installed software and packages. The following command is used to check new updates:
$ yum check-update
Using ‘yum’ command, you can download and install new updates on your system. This will keep your system up-to-date. Run the below-mentioned command on the terminal:
$ yum update
Using ‘yum’ command, you can install only security updates on your system. The following command is used to install security updates:
$ yum update --security
Using ‘yum’ command, you can update specific packages or software on your system. The syntax of this command is given below:
$ yum update {package-name-1} Example
$ yum update dnf
I have updated the dnf package on my system with the above-mentioned command.
You can update a package to a new version. First, you will display the duplicate list of the Nginx package. The syntax of this command is given below:
$ yum --showduplicates list nginx
Now, you will update this package to the new version.
$ yum update-to nginx-version $ yum update-to nginx-1.12.2-1.el7
Using the ‘yum’ package manager, you can view the list of all installed packages on your system. Type the following command on the terminal:
$ yum list installed
You can also check whether a particular package is installed or not on your system:
$ yum list installed dnf
You can view the list of all packages that are available for installation. For this purpose, the following command is used:
$ yum list available $ yum list available | more $ yum list available | grep httdp
You can try more commands related to yum list as follows:
$ yum list $ yum list | more $ yum list | grep bash
You can find a specific package with a description through the search command. You will use the list command along with the search command.
The basic syntax is given below:
$ yum list {package-name} For example, if you want to list all rpm packages then you will use the following commands:
$ yum list rpm*
$ yum search {package-name} For example, if you want to search all python packages then you will use the following commands:
$ yum search python $ yum search python*
You can view all information about a specific package. The syntax is given below:
$ yum info {pkg-1} {pkg-2} For example, if you want to display all information of dnf and rpm package then the following command will be used:
$ yum info dnf
You also view the list of dependencies for a package. The basic syntax is as follows:
Syntax
$ yum deplist {pkg} Example
For example, I displayed the list of dependencies for an ‘rpm’ package.
$ yum deplist rpm
You can install a specific package on your system using the' yum' package manager. Use the following syntax:
$ yum install {package-name-1} {package-name-2}
For example, you can install ‘httdp’ package using the following command:
$ sudo yum install httpd
Type the following command to install a package as a group:
The following more useful commands are mentioned below in tabular form:
| Yum command | Purpose |
| $ yum localinstall {pkg} | Install a package from a local file or server. |
| $ yum downgrade {pkg} | Downgrade a package to a previous version. |
| $ yum reinstall {pkg} | Reinstall a package or software |
| $ yum remove {pkg} $ yum erase {pkg} | Remove a specific package |
| $ yum autoremove | Auto removed unneeded packages |
| $ yum list all | Display list of all available packages |
| $ yum grouplist | Display group software list |
| $ yum groupupdate {grouppackage} | Update group packages |
| $ yum groupremove {pkg} | Remove group packages |
| $ yum list extras | Display packages that are not available via repositories or subscribed channels |
| $ yum clean all | Clean cache |
| $ yum repolist | Display list of software repositories |
| $ yum repoinfo {reponame} | Display the information about yum enabled repositories |
| $ yum history or $ yum history list | Display yum history |
| $ yum help install $ man yum $ yum help | Yum help |
In this article, you have learned the use of different yum commands on Rocky Linux 9. I hope this will be useful for you and that you enjoyed this tutorial.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…