4

I've run into a bit of an issue with rpm on an Oracle Linux 6.5 box.

I installed an RPM, and it appears to have installed successfully. However, now I am trying to remove it, but rpm says it's already installed. I am trying to uninstall it by package name, not the full *.rpm name. Ex:

[root@server06 ~]# rpm -ivh package-10.0.0B116-02202013-x64.rpm

Preparing...                ########################################### [100%]
        package custom-linux-9026-10.0.0-BUILD116.noarch is already installed

[root@server06 ~]# rpm -ql package-10.0.0B116-02202013-x64.rpm
package package-10.0.0B116-02202013-x64.rpm is not installed

[root@server06 ~]# rpm -q package-10.0.0B116
package package-10.0.0B116 is not installed

[root@server06 ~]# rpm -e package-10.0.0B116
error: package package-10.0.0B116 is not installed

So the system won't let me install it again because it thinks it's already there, but won't let me uninstall it because it thinks it's not there.

rpm -qa |grep -i package returns nothing.

rpm --rebuilddb doesn't help either.

1
  • My guess is that it's not always obvious what the package name, the package version, and what the package release are when you see the combined string. I think either only the package name (when there only exists one such package), or the complete package_name-version-release string is needed.
    – U. Windl
    Nov 18 '20 at 7:29
4

Notice the line:

package custom-linux-9026-10.0.0-BUILD116.noarch is already installed

So despite the filename of package-10.0.0B116-02202013-x64.rpm the package (in rpm header) is likely named custom-linux-9026-10.0.0-BUILD116. So you must call

rpm -e custom-linux-9026-10.0.0-BUILD116
2

If you still have the original rpm file, extract the package name from it with -qp and the filename, eg

$ rpm -qp ~/myrpm-1.0-05077.i586.rpm
myrpm-1.0-05077.i586

and try using that in the rpm erase, as the filename might not match the package name.

1
  • This! Thanks :)
    – versvs
    Aug 14 '19 at 5:44
0

rpm -aq | grep -i package.rpm if still not getting the output, then run updatedb command and try again

i will if ignore case sensitive

If you want to remove the rpm please give the full package name.

rpm -e package-10.0.0B116-02202013-x64.rpm

1
  • I already tried those: [root@server06 ~]# updatedb [root@server06 ~]# rpm -qa |grep package-10.0.0B116-02202013-x64.rpm [root@server06 ~]# [root@server06 ~]# rpm -e package-10.0.0B116-02202013-x64.rpm error: package package-10.0.0B116-02202013-x64.rpm is not installed [root@server06 ~]# rpm -e package-10.0.0B error: package package-10.0.0B is not installed
    – Andi
    May 12 '16 at 15:04
0

The real problem seems to be that the package you are trying to remove wasn't actually installed:

Preparing...                ########################################### [100%]
        package custom-linux-9026-10.0.0-BUILD116.noarch is already installed

And the package name seems to be custom-linux-9026-10.0.0-BUILD116.noarch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.