13 Linux Yum Command Examples – Install, Uninstall, Update Packages

0
1819

Installing, removing, and updating packages is a typical activity on Linux. Most of the Linux distributions provides some kind of package manager utility. For example, apt-get, dpkg, rpm, yum, etc.

On some Linux distributions, yum is the default package manager.

Yum stands for Yellowdog Updater Modified.

This article explains 15 most frequently used yum commands with examples.

1Install a package using yum install

To install a package, do ‘yum install packagename’. This will also identify the dependencies automatically and install them.

The following example installs postgresql package.

[root@yum emre]# yum install wget
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-15.el7_4.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================
 Package Arch Version Repository Size
=================================================================================================================
Installing:
 wget x86_64 1.14-15.el7_4.1 rhui-rhel-7-server-rhui-rpms 547 k
Transaction Summary
=================================================================================================================
Install 1 Package
Total download size: 547 k
Installed size: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
wget-1.14-15.el7_4.1.x86_64.rpm | 547 kB 00:00:01 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : wget-1.14-15.el7_4.1.x86_64 1/1 
 Verifying : wget-1.14-15.el7_4.1.x86_64 1/1 
Installed:
 wget.x86_64 0:1.14-15.el7_4.1 
Complete!

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

yum -y install wget

Back

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.