15 Useful YUM commands in Linux – Introduction
YUM (Yellowdog Updater, Modified) command is a package management system used in various Linux distributions. It is a command-line utility that allows users to install, update, and manage software packages on their Linux systems.
Software packages and their dependencies are downloaded and installed using YUM from a common repository. The repository contains a collection of software packages that are tested, verified, and optimized for the specific Linux distribution.
YUM commands in linux are typically run as superusers or with sudo privileges since they require access to system resources and software repositories. With YUM, system administrators can manage software packages on their Linux systems more efficiently and ensure that their systems are always up to date with the latest software versions and security patches.
How to use YUM commands in Linux
You must launch a terminal window to utilize YUM commands in Linux and run the command with the correct options. An example of how to install a package using the yum install command is as follows:
Activate the terminal window.
Enter the command you just typed in:
sudo yum install <package_name>
Replace <package_name> with the name of the package you want to install.
The system will prompt you to enter your sudo password. Enter the password and press Enter.
The system will download and install the package and its dependencies (if any).
-
Using YUM, install a package
The yum command in linux is used to manage packages on Red Hat-based Linux distributions such as CentOS, Fedora, and RHEL. Here’s how you can use Yum to install a package:
On your Linux computer, launch a terminal window.
To update the package database and make sure you have the latest information about available packages, run the following command:
sudo yum update
Install a package using the following command, replacing package-name with the name of the package you want to install:
sudo yum install package-name
There you go! With the yum command, you have successfully installed a package.
-
Using the YUM command in Linux to remove a package
The methods below explain how to uninstall a package using the yum command:
On your Linux computer, launch a terminal window.
To uninstall a package, enter the following command, replacing package-name with the name of the package you want to remove:
sudo yum remove package-name
For example, to remove the htop process monitoring tool, you would run:
sudo yum remove htop
yum, will check if the package is installed on your system and ask for your confirmation before removing it. If you’re prompted, type y and hit Enter to continue with the removal.
Wait for the package to be removed. Once the removal is complete, the package will no longer be available on your system.
-
Removing a package using the YUM commands in Linux
To update a package, use the yum command as shown below:
A terminal window should be opened on your Linux PC.
To ensure you get the most latest information about packages that are available, run the following command to update the package database:
sudo yum update
Use the following command to update a specific package, substituting package-name with the name of the package you wish to update:
sudo yum update package-name
-
List a package
With the yum command, adhere to these procedures to list a package:
Open a terminal window on your Linux system.
Run the following command to see a list of all packages that are accessible in the Yum repositories:
sudo yum list available
This will show a list of every package that is accessible in the Yum repositories.
Use the command below, substituting package-name with the name of the package you’re looking for, to locate a specific package:
sudo yum search package-name
-
Use YUM to find a package
The steps below can be used to find a package using the yum command:
A terminal window should be opened on your Linux PC.
Use the following command to locate a package, substituting package-name for the desired package’s name:
sudo yum search package-name
For example, to search for the vsftpd, you would run:
sudo yum search vsftpd
-
Learn more about a package
If you want to learn more about a package before installing it, then using the following command, you can learn more about a package.
sudo yum info firefox
It will give you all the information about Firefox. Like that
-
List every package that is offered
Follow these steps to use the yum command to list all available packages:
Open a terminal window on your Linux system.
Run the following command to see a list of all packages that are accessible in the Yum repositories:
sudo yum list available
This will display a list of all available packages in the Yum repositories.
Review the output to see the list of all available packages. The output will include the name of the package, version number, and other relevant details.
You can use this list to search for specific packages or to get an idea of what packages are available in the yum repositories.
That’s it! You have successfully listed all available packages using the yum command.
-
List all Installed Packages using YUM
Use the command below to list every installed package on a system. It will show you every package that is currently installed.
sudo yum list available
-
Provides Function
You may learn which package supplies a specific file or command by using the yum provides function. Use the following command, replacing file-or-command-name with the name of the file or command you want to check up, to see which package supplies a specific file or command.
sudo yum provides file-or-command-name
For example, to find out which package provides the ls command, you would run:
sudo yum provides ls
yum, will search its repositories for packages that provide the specified file or command and display a list of matches. The output will include the name of the package, version number, and other relevant details.
-
Look for any new developments
To check for available updates using the yum command, follow these steps:
Open a terminal window on your Linux system.
To check for available updates, run the following command:
sudo yum check-update
This command will connect to the Yum repositories and check for any available updates for your installed packages.
-
Update the System
To update your system using the yum command, follow these steps:
Open a terminal window on your Linux system.
Before updating the system, performing a full system backup or creating a snapshot if you’re using a virtual machine is recommended.
Run the following command to update your system:
sudo yum update
By connecting to the Yum repositories, this script will look for any updates for the installed packages. Your decision to download and install the updates will then be prompted.
When requested to confirm that you wish to move forward with the update process, type “y” after reviewing the list of updates that need to be installed.
The system updates will then be downloaded and installed by Yum. Depending on how many packages need to be updated, this could take a while.
Restart your computer after the update process is finished to make sure all updates have been properly included.
That’s it! You have successfully updated your system using the yum command.
-
List all group packages
A certain set of packages are packed together in Linux. Yum enables you to install a certain group that will install all the associated packages that are a part of the group, as opposed to having to install each package one at a time. Use the following command, for instance, to list every group available.
sudo yum grouplist
This will display a list of all available package groups on your system shown below.
# yum grouplist
Installed Groups: Administration Tools DNS Name Server Dialup Networking Support Editors Engineering and Scientific FTP Server Graphics Java Development Legacy Network Server Available Groups: Authoring and Publishing Base Beagle Cluster Storage Clustering Development Libraries Development Tools Eclipse Educational Software KDE (K Desktop Environment) KDE Software Development
|
-
Install Group Packages
List the available group packages on your system using the yum grouplist command.
sudo yum grouplist
Select the group package that you want to install from the list displayed.
Use the yum groupinstall command to install the selected package group.
sudo yum groupinstall group_name
Use the name of the package group you want to install in place of the group name.
The yum command will prompt you to confirm the installation of the selected package group. Type y and press Enter to proceed.
Wait for the installation process to complete.
That’s it! The selected package group should now be installed on your system. Note that some package groups may require additional configuration or setup steps after installation. Be sure to consult the relevant documentation for each package group to ensure that it is properly configured and ready to use.
-
Update Group Packages
Use the yum grouplist command to see a list of your system’s available group packages.
sudo yum grouplist
Identify the group package that you want to update.
Use the yum groupupdate command to update the selected package group.
sudo yum groupupdate group_name
Use the name of the package group you want to update in place of the group name.
The yum command will prompt you to confirm the update of the selected package group. Type y and press Enter to proceed.
Wait for the update process to complete.
That’s it! The selected package group should now be updated to the latest available version on your system. Note that some package groups may require additional configuration or setup steps after the update. Be sure to consult the relevant documentation for each package group to ensure that it is properly configured and ready to use.
-
Remove Group Packages
To remove a group package using the yum command, follow these steps:
With the yum grouplist command, you can list the group packages that are available on your system.
sudo yum grouplist
Identify the group package that you want to remove.
Use the yum groupremove command to remove the selected package group.
sudo yum groupremove group_name
Use the name of the package group you want to remove in lieu of group name.
The yum command will prompt you to confirm the removal of the selected package group. Type y and press Enter to proceed.
Wait for the removal process to complete.
That’s it! The selected package group should now be removed from your system. Note that removing a package group may also remove some of the individual packages that were installed as part of that group. Be sure to review the list of packages that will be removed before confirming the removal of a package group to avoid accidentally removing any important packages.
Wrapping Up
YUM commands in linux are used to manage the software packages and repositories on the system. Some of the most commonly used YUM commands include installing, updating, removing, searching, listing, check-update, and cleaning. These commands can be used to install new packages, update existing packages, remove packages, search for packages, list installed packages, check for updates, and clean the YUM cache.
You can learn about linux more deeply by clicking the link below
https://linuxiron.com/what-is-linux-a-whole-introduction/
Learn about the other linux commands by clicking the links below
https://linuxiron.com/echo-command-in-linux/
https://linuxiron.com/how-to-use-nice-renice-commands-in-linux/
https://linuxiron.com/how-to-use-kill-commands-in-linux/
https://linuxiron.com/a-beginners-guide-to-htop-for-process-management/
The main tool for downloading, installing, uninstalling, querying, and managing RPM software packages for Red Hat Enterprise Linux comes from third-party and official Red Hat software repositories. Red Hat Enterprise Linux versions 5 and later use yum.
RPM file installation with Yum
You can also install it. rpm files by using the Yum package manager. The localinstall option instructs Yum to search for the installation file in your current working directory.
The groupinstall command, assuming you’re referring to yum, installs a collection of packages that have been defined as a group, so you don’t have to install a lot of separate packages to get all the functionality.
Python modules (.py files) that are used by Yum as plugins are loaded when Yum first launches. One of the reasons for creating plugins was to provide a space for functionality that was deemed uncommon or undesirable for the core Yum package. In general, plugin functionality won’t be relocated to or added to the core yum package.
RPM is independent and uses its database to store details about the packages installed on the system. A front-end tool called YUM manages packages by using the RPM package manager. The backend of the tool also makes use of the RPM database.