Installing and Managing Packages with Yum
Yum provides a straightforward interface for installing, updating, and removing software packages on your Linux system. In this section, we'll explore the key Yum commands and their usage.
Installing Packages with Yum
To install a package using Yum, you can use the following command:
sudo yum install package_name
This command will search for the specified package in the configured repositories, resolve any dependencies, and install the package on your system.
For example, to install the Nginx web server on Ubuntu 22.04 using Yum, you can run:
sudo yum install nginx
Updating Packages with Yum
Yum makes it easy to keep your system up-to-date by automatically checking for and installing package updates. To update all installed packages, use the following command:
sudo yum update
This will update all packages on your system to their latest available versions.
You can also update a specific package by running:
sudo yum update package_name
Removing Packages with Yum
If you no longer need a package, you can remove it using the following command:
sudo yum remove package_name
This will uninstall the specified package and any dependencies that are no longer required.
Checking Package Versions with Yum
To check the version of an installed package, you can use the following command:
yum list installed | grep package_name
This will display the installed version of the package.