Loading...
Real Time Concepts

YUM Commands

1) How to display a list of updated software and security fix

yum list updates

2) How to find out whether updates exist for packages that are already installed on my system

yum check-update

3) Patch up system by applying all updates (yum update will attempt to update every package that’s installed on your system.)

yum update

If you use ( yum upgrade ) it will do the same as ( yum update ) , except it will attempt to remove any packages that have been marked as “obsolete”.

4) You can only apply security-related package updates using the following syntax:

yum update --security

5) Updates the specified package. The syntax is

yum update {package-name-1}

To check for and update httpd package, enter:

yum update httpd

6) To exclude a package (in this example, those related to the kernel):

yum update --exclude=kernel*

You can exclude multiple packages with more –exclude flags.

yum update --exclude=kernel* --exclude=httpd

7) To install Httpd package

yum install httpd
yum remove httpd

8) To list all installed packages, enter:

rpm -qa

## not recommend just use yum ##

yum list installed

EXamaple :

rpm -qa | grep httpd*
yum list installed httpd


9) Lists all packages that are available for installation
To list all the available packages in the Yum database, use the below command.

yum list available
yum list available | more
yum list available | grep nginx

10) How to search for packages by name

yum list httpd
yum list perl*
yum search nginx
yum search nginx*


11) How to see detailed information about a package

yum info htop
yum info nginx htop

12) How to view and use yum history

yum history
yum history list

13) List Enabled Yum Repositories
To list all enabled Yum repositories in your system, use following option.

yum repolist

14) The following command will display all enabled and disabled yum repositories on the system.

yum repolist all

15) Install a Package from Specific Repository
To install a particular package from a specific enabled or disabled repository, you must use –enablerepo option in your yum command.

yum --enablerepo=epel install phpmyadmin
Leave a Reply

Your email address will not be published. Required fields are marked *