SYS: Learn to use the yum command.

Share this link

Presentation of yum

yum is a sophisticated piece of software in charge of dealing with packages and their dependencies.
yum will be deprecated in future versions of RHEL. But its successor, dnf, will reuse the same syntax.

Basic Features

To install a new package (here httpd), type:

# yum install httpd

To remove an existing package (here httpd), type:

# yum remove httpd

To get some details about a package (here httpd), type:

# yum info httpd

To install a package group (here “Web Server”), type:

# yum groupinstall "Web Server"

To remove a package group (here “Web Server”), type:

# yum groupremove "Web Server"

To get the list of installed package groups, type:

# yum grouplist

To get some details about a package group (here “Web Server”), type:

# yum groupinfo "Web Server"

To define which package provides a specified file (here semanage), type:

# yum whatprovides */semanage

To search for a particular string (here seinfo), type:

# yum search seinfo

To update the current base of installed packages, type:

# yum update

Note: To get the list of the packages to restart after upgrade, type: # needs-restarting

To get the list of all the available packages, type:

# yum list

To get the list of all the installed packages, type:

# yum list installed

To display the list of all the available but not alerady installed packages, type:

# yum list available

To get the list of the available repository, type:

# yum repolist

To clean up the yum cache, type:

# yum clean all

To get the list of the dependencies associated with a package (here httpd), type:

# yum deplist httpd

Additional Resources

In addition, you can look at Red Hat yum command cheat sheet or watch this Red Hat video about yum basic features.
Rosehosting provides a tutorial about getting package information with yum.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

2
Leave a Reply

Please Login to comment
1 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
CertDepotGjorgi Recent comment authors
  Subscribe  
newest oldest
Notify of
Gjorgi
Member
Gjorgi

yum search versus yum list: first searches through metadata of a package, users could wrongly assume it searches for packages themselves. The second searches for available actual packages, either installed or offered to be installed.

Upcoming Events (Local Time)

  1. Feb
    1
    Fri

    1. 8:30 am - View Details
      CentOS: Dojo, Brussels, Belgium.

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create a user account named "tony" with password “redhat” and belonging to a secondary group called “team”.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a caching-only DNS server.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...