Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Do you intend to reinstall the rpm once you get the broken version removed?
What is the name of the rpm? There are some rpms that will result in a system crash if you remove them.
-----------------------
Steve Stites
Hi jailbait,
Thanks for the reply. The RPM package is third party one custom build by our company.
Code:
rpm -ql packagename
Shows everything is installed under /opt, which I removed entirely. Since that linux machine is not connected to network, I can only describe the err message:
Code:
chmod: Cannot access /opt/... No such file or directory
/var/tmp/rpm-tmp.82404 line xx: /opt/... No such file or directory
Error: %preun(packagename) scriptlet failed, exit status 1.
I guess with all the files removed, I just need to "unregister" the rpm package to make it marked as uninstalled, so I can install the package again.
The easiest way is usually just to reinstall the rpm (use the force option). This will reinstall the files you removed. Then uninstall the rpm. After that, go back and remove the left over files.
What lazlow says is correct. In addition you may run into a few problems with the rpm script if it wasn't written to take such things as missing directories into consideration. Try recreating some of the missing directories:
mkdir /opt
That might get you past some poor coding in the rpm script.
I disagree. If one fscked up by deliberately removing files by hand instead of uninstalling the package it is not the package managers fault nor "poor coding" but PEBCAK. Reinstalling the package to uninstall it is unnecessary. AFAIK the OP is right if he just needs to "unregister" it (never mind the connotations of the term). Executing 'rpm --justdb -e packagename' should do just that.
I agree that diego_cn should be able to uninstall the rpm even though he has deleted /opt. He also says in his second post that he wants to install the rpm again. So installing the new rpm with update or force is also a viable way to override the old rpm.
I have seen rpm packages that assume that such things as /opt or /usr exist and fail if they don't. Since this rpm was written in house and not by a distribution it is quit possible that it doesn't have if statements creating /opt if /opt does not exist, etc.
That's what I am looking for. Thanks for all your helps.
To clarify the matter a little bit more, for future reference: The original rpm packages was coded such that it has to install through a external script file. Therefore it cannot be manually installed. So reinistall with --force option does not work here.
p.s yum has spoiled me and I forget much of the rpm arguments already
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.