Yellowdog Updater, Modified (YUM) stands as one of the most popular package management tools in RPM-based Linux distributions like CentOS. It enables users to easily install, update, remove, and manage software on their systems. In this article, you'll learn how to install YUM (if not already installed), how to use it for common package management tasks, and how to configure additional repositories to extend the available software.
Installing YUM
By default, YUM should already be installed on most CentOS 7 systems. You can verify its installation and version by running the following command in the terminal:
yum --version
If you find YUM is not installed, you can install it using the following command (though this is unlikely as YUM is a fundamental part of CentOS):
sudo rpm -ivh yum*.rpm
Basic Usage of YUM YUM simplifies package management on your system through straightforward commands. Here are some of the most commonly used commands:
-
Installing Packages: To install a new package, use:
sudo yum install package_name
-
Updating Packages: To update all installed packages to their latest available versions:
sudo yum update
-
Removing Packages: To remove a package from the system:
sudo yum remove package_name
-
Searching for Packages: If you're unsure of the package name, you can use the
search
command:sudo yum search keyword
- Listing All Available Packages: To display all packages available in the repositories:
sudo yum list available
Configuring Repositories
CentOS utilizes repositories for package management, which contain software. YUM allows adding, removing, and managing these repositories. Adding a new repository can expand the options of software available for installation. To add a repository, create a new .repo
file in the directory /etc/yum.repos.d/
with information about the repository.
YUM is a powerful and flexible package management tool on CentOS 7 systems, simplifying the installation, updating, and management of software. Its straightforward commands and repository configuration capability make YUM an essential tool for any system administrator. With a basic understanding of YUM commands and repository configuration, you can effectively manage software on your system, keeping it updated and secure.