Yum Command In Linux With Examples

Yum Command In Linux With Examples

Yum stands for Yellow dog Updater Modified. Yum is a  Package Management tool for installing, removing, updating, and managing Linux RPM software packages.

with yum command in Linux we can Install New Package From Repository, We can update the packages, We can uninstall or remove the packages, with yum command we can check the packages that have updates available for installation. We can view the package information And We can list the repositories , we can add the new repositories, we can enable and disable repositories. in the following steps i will explain yum command in linux with examples.

Install a package using yum install command

By using yum install command we can install any package in rhel or centos.

The following example is to install httpd

yum installed httpd

By default ‘yum install’, will prompt you, “yes or no”  before installing the packages. If you want yum to install automatically without prompting, use -y option as shown below.

Yum install httpd -y

Uninstall package

yum remove httpd

You can remove any package with yum remove command, here it will remove httpd package.

Check package is installed or not

you can check is package is installed or not by using yum list installed command

yum list installed package

in the following example i verified the httpd package is installed or not. you can in the below code section, in installed packages it showing httpd.x86_64 that means httpd is installed in my system.

[root@localhost ~]# yum list installed httpd
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
Installed Packages
httpd.x86_64                  2.4.6-88.el7                   @rhel-7-server-rpms

Check For package Updates

To check for any updates available for your installed packages you can use this command

yum check-update

list the packages

yum list

it will show you all the packages available in your repository

list installed packages

yum list installed

if you want to know the list of packages that installed on your Linux system you can use this command.

search for any package

yum search docker

yum search httpd

if you want to search for any package you can use yum search command.

it will show you different versions of package which are available

know more about yum

if you want to know more about yum command use below command.

man yum

 

Leave a Reply

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