Linux Tutorial
Linux File/Directory Management
Linux Packaging And Compression
Vim Text Editor
Linux Text Processing
Linux Software Installation
Linux User/User Group Management
Linux Permission Management
Linux Filesystem Management
Linux Advanced Filesystem Management
Linux System Management
Linux Backup and Recovery
Linux System Service Management
Linux System Log Management
Linux Boot Management
LAMP/LNMP Environment
SELinux Management
yum
, short for Yellowdog Updater, Modified, is a package manager for RPM-based Linux distributions such as CentOS, RHEL, and Fedora. It helps users manage software packages, including installation, updates, and removal. In this tutorial, you'll learn some essential yum
commands to manage packages on your Linux system.
1. Update package list
Update the local package repository with the latest information from remote repositories:
sudo yum check-update
2. Install a package
Install a package by specifying its name:
sudo yum install package_name
Example: To install wget
:
sudo yum install wget
3. Update a package
Update a specific package to the latest version:
sudo yum update package_name
Example: To update wget
:
sudo yum update wget
4. Update all packages
Update all installed packages to their latest versions:
sudo yum update
5. Remove a package
Remove a package along with its dependencies:
sudo yum remove package_name
Example: To remove wget
:
sudo yum remove wget
6. Search for a package
Search for a package by its name or description:
sudo yum search keyword
Example: To search for packages related to "editor":
sudo yum search editor
7. Display package information
Show detailed information about a package:
sudo yum info package_name
Example: To display information about wget
:
sudo yum info wget
8. List installed packages
Display a list of all installed packages:
sudo yum list installed
9. List available packages
Display a list of all packages available for installation:
sudo yum list available
10. List package groups
Display a list of available package groups:
sudo yum grouplist
11. Install a package group
Install a group of packages together:
sudo yum groupinstall "Group Name"
Example: To install the "Development Tools" group:
sudo yum groupinstall "Development Tools"
12. Remove a package group
Remove a group of packages:
sudo yum groupremove "Group Name"
Example: To remove the "Development Tools" group:
sudo yum groupremove "Development Tools"
13. Clean cache
Clear the yum
cache to remove outdated package information:
sudo yum clean all
In conclusion, the yum
package manager is an essential tool for managing software packages on RPM-based Linux distributions. This tutorial covered the most common commands for installing, updating, searching, and removing packages, as well as managing package groups. Familiarizing yourself with these commands will help you effectively maintain your Linux system.
How to use yum commands in Linux:
# Example: Basic yum command yum --version
Installing packages with yum on CentOS:
# Example: Install a package with yum yum install package_name
Updating system packages using yum:
# Example: Update system packages with yum yum update
Removing packages with yum command:
# Example: Remove a package with yum yum remove package_name
Listing installed packages with yum in Linux:
# Example: List installed packages with yum yum list installed
Resolving dependencies with yum:
# Example: Resolve dependencies with yum yum install package_with_dependencies
Searching for packages using yum search:
# Example: Search for a package with yum yum search package_keyword
Yum repository management and configuration:
# Example: Edit yum repository configuration nano /etc/yum.repos.d/repository_name.repo
Enabling and disabling repositories with yum:
# Example: Disable a repository with yum yum-config-manager --disable repository_name
Troubleshooting common issues with yum commands:
# Example: Clean yum cache for troubleshooting yum clean all