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.

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

Leave a Reply

2 Comments on "SYS: Learn to use the yum command."

Notify of
Sort by:   newest | oldest
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.

wpDiscuz

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create two users "tom" and "engine". "tom" has the UID/GID 3000 and "engine" the UID/GID 4000. "engine" doesn't have an interactive shell.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a default secure MariaDB database called maria with a user named muser with all privileges.

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 ...