Sunday, March 24, 2019

Tech Notes:- Yum reinstall command

The Problem

Often we encounter scenarios where we have to re-install packages in yum. Here I am explaining one such scenario.

Last week I installed an application using yum and then removed the rpm packages one by one. And then deleted the application folder. Later I decided to install it back and I used yum to install it. But after I installed the application I noticed that the application was not launching. On investigation, I could find that the yum install did not install certain dependancy packages which had some libraries required for the application to start.

Analysis

So what happened here?. Although I removed most of the packages using rpm, I missed to remove certain dependency packages and then later when the folder was deleted, the files associated with the dependency packages got deleted. But as per yum database, the dependency package is still installed and when we installed it using yum the second time, these packages were skipped.

Solution

How to deal with this?. First of all we have to find out which package provides the missing files.

rpm -qf filename

Now we can ascertain that the file is part of the dependency package for the packages we installed using yum.

Fortunately, yum has an option called reinstall which will completely re-install the packages including the dependancy packages. The syntax is simple

yum reinstall PACKAGE_NAME




No comments:

Related Posts Plugin for WordPress, Blogger...