rpm -e 没有删除安装目录
所有,
我使用 rpm.spec 文件创建了一个 RPM 包。软件包安装成功。当我使用 rpm -e 删除软件包时,它从 RPM 数据库中删除,
但 pkg 创建的目录结构并未删除。
请帮我解决这个问题。
All,
I created a RPM package using rpm.spec file. The package installed succesfully. When i remove the package using rpm -e it removed from RPM database
But directory structure that the pkg created was not removed.
Please help me to resolve this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的规范文件存在几个问题:
%files
部分为空,您的 RPM 根本不包含任何文件(尝试rpm -ql packagename
);%pre
和%post
中完成所有工作;%post
太复杂了。由于您的 RPM 中根本没有任何文件,因此当您卸载它时,它不会删除任何内容,这是合乎逻辑的。至于其他问题,如果你的
%post
脚本是RPM提供的文件,并且提供另一个脚本来清理,那就更好了。然后,你的 pre、post、preun 和 postun 部分将如下所示:但考虑到你在这里所做的事情,你最好使用像 Puppet 之类的工具。
There are several problems with your spec file:
%files
section is empty, your RPM contains no files at all (try andrpm -ql packagename
);%pre
and%post
;%post
is too complicated.As there are no files at all in your RPM, it will not remove anything when you uninstall it, which is logical. As to the other problems, it would be much better if your
%post
script is a file provided by the RPM, and that another script is provided for cleaning up. Then, your pre, post, preun and postun section would look like:But given what you do here, you are probably better off using a tool like Puppet or such.