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

Linux yum Commands

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.

  1. How to use yum commands in Linux:

    • Description: Yum is a package manager for RPM-based systems, facilitating package installation, updates, and removal.
    • Code:
      # Example: Basic yum command
      yum --version
      
  2. Installing packages with yum on CentOS:

    • Description: Use yum to install packages from repositories or local sources.
    • Code:
      # Example: Install a package with yum
      yum install package_name
      
  3. Updating system packages using yum:

    • Description: Keep your system up-to-date by using yum to update installed packages.
    • Code:
      # Example: Update system packages with yum
      yum update
      
  4. Removing packages with yum command:

    • Description: Uninstall unwanted packages with the yum remove command.
    • Code:
      # Example: Remove a package with yum
      yum remove package_name
      
  5. Listing installed packages with yum in Linux:

    • Description: View a list of installed packages on your system using yum.
    • Code:
      # Example: List installed packages with yum
      yum list installed
      
  6. Resolving dependencies with yum:

    • Description: Yum automatically resolves and installs dependencies for the requested packages.
    • Code:
      # Example: Resolve dependencies with yum
      yum install package_with_dependencies
      
  7. Searching for packages using yum search:

    • Description: Search for available packages in repositories using yum search.
    • Code:
      # Example: Search for a package with yum
      yum search package_keyword
      
  8. Yum repository management and configuration:

    • Description: Manage and configure yum repositories to control package sources.
    • Code:
      # Example: Edit yum repository configuration
      nano /etc/yum.repos.d/repository_name.repo
      
  9. Enabling and disabling repositories with yum:

    • Description: Enable or disable repositories to control package availability.
    • Code:
      # Example: Disable a repository with yum
      yum-config-manager --disable repository_name
      
  10. Troubleshooting common issues with yum commands:

    • Description: Diagnose and resolve issues such as dependency problems or repository errors.
    • Code:
      # Example: Clean yum cache for troubleshooting
      yum clean all