Home » Linux Basics » CentOS: yum Command Reinstall Package

CentOS: yum Command Reinstall Package

How do I re-install a package using the yum command under CentOS Linux server?

You can use the yum command with the reinstall option. This will reinstall the identical versioned package as currently installed. The syntax is as follows:

 
yum reinstall packageName
yum reinstall packageName1 packageName2

In this example reinstall a package called keepalived, type:
# yum reinstall keepalived
Sample outputs:

Loaded plugins: product-id, rhnplugin, subscription-manager
Updating certificate-based repositories.
Setting up Reinstall Process
Resolving Dependencies
--> Running transaction check
---> Package keepalived.x86_64 0:1.2.2-2.el6 will be reinstalled
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================
 Package                             Arch                            Version                                 Repository                     Size
=================================================================================================================================================
Reinstalling:
 keepalived                          x86_64                          1.2.2-2.el6                             epel                          147 k
Transaction Summary
=================================================================================================================================================
Reinstall     1 Package(s)
Total download size: 147 k
Installed size: 380 k
Is this ok [y/N]: y
Downloading Packages:
keepalived-1.2.2-2.el6.x86_64.rpm                                                                                         | 147 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : keepalived-1.2.2-2.el6.x86_64                                                                                                 1/1
Installed products updated.
Installed:
  keepalived.x86_64 0:1.2.2-2.el6

Originally posted 2016-02-24 23:55:53.

About admin

I have been working with Linux based systems since 2002. I hope the article published on this site will be useful to those new to server administration.