0

i'd have a problem: can't install package "TD-agent". Cause there are deadlock:

If u try to install (sudo rpm -ivh /my/pass/td-agent-3.2.1-0.el7.x86_64.rpm) - u have an error:

Preparing...                          ################################# [100%]
        package td-agent-3.2.1-0.el7.x86_64 is already installed

If u try to uninstall it (rpm -e td-agent) - have another error:

Stopping td-agent ...
error reading information on service td-agent: No such file or directory
error: %preun(td-agent-3.2.1-0.el7.x86_64) scriptlet failed, exit status 1
error: td-agent-3.2.1-0.el7.x86_64: erase failed

So, i can't do anything: no install, no uninstall...

Please, answer: how to manualy uninstall it? What DIRs RPM use to install packages?

2 Answers2

0
  1. you can force rpm to reinstall the package with the same number using: rpm -ivh /my/pass/td-agent-3.2.1-0.el7.x86_64.rpm --replacepkgs
  2. You can force the uninstallation by telling rpm not to run the scripts: rpm -e td-agent --noscripts
Chris Maes
  • 35,025
  • 12
  • 111
  • 136
  • Sorry, script exec'ed, but did nothing: `rpm -e td-agent --noscripts` ran in second, but after it `sudo systemctl status td-agent` printed td-agent still alive and even works. – Antispam Antispam Dec 17 '18 at 12:16
  • There is a difference between both: run `rpm -q td-agent` to check if the package is still installed. Probably not. Systemd however has your files in cache; so that is still running. – Chris Maes Dec 17 '18 at 12:27
  • does "uninstall" means: 1. stop all daughter-process, 2. delete package, 3. remove all dependences (like folders)? So, uninstall means: `sudo systemctl start td-agent >>> Failed to start td-agent.service: Unit not found.` Isn't it? – Antispam Antispam Dec 17 '18 at 12:32
  • No. Uninstall means: remove all files. Period. Whatever else happens depends on the scripts you specify in your spec file (but note that to force uninstallation we disabled them now using `--noscripts`) – Chris Maes Dec 17 '18 at 12:36
  • https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets : a great resource on the order of scripts – Chris Maes Dec 17 '18 at 12:36
0

Also force install can be done via command

rpm -Fvh /my/pass/td-agent-3.2.1-0.el7.x86_64.rpm
Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31