6

I tested installing a package for which I had to use yum localinstall <pkgfile>.rpm. Worked fine, but I cannot figure out how to remove it. How can I achieve that?

2 Answers 2

9

Either yum erase <package_name> or rpm -e <package_name> should remove any installed package. yum localinstall has been deprecated for some time, and in current versions of Fedora, as well as RHEL 8, it's simply an alias for yum install

3
  • 2
    ... or even dnf install. Commented Dec 17, 2020 at 18:05
  • This doesn't seem to work after you install a local file RPM via yum install *.rpm. Uninstalling via yum erase *.rpm throws this error: ``` No Match for argument: <filename>.rpm No Packages marked for removal ```
    – Richard
    Commented Mar 30, 2022 at 18:33
  • 2
    As far as I am aware, you shouldn't use the ".rpm" extension when erasing the package - just use the package name.
    – patbarron
    Commented Mar 31, 2022 at 0:27
1

I have just been through this process. The filename for the rpm package I installed was not the same as the package name.

It is possible to find packages that have been installed using yum localinstall by using yum list | grep commandline.

The package name will be on the left of the output of that command (there may of course be multiple packages if you've installed multiple rpms from files so you may have to find the one you want), and you can feed that to yum erase as indicated in patbarron's answer (i.e. yum erase <package_name>).

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Oct 9, 2023 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .