如何使用rpm删除一些多余的文件夹

发布于 2024-08-11 01:39:36 字数 166 浏览 4 评论 0原文

我使用的是 Fedora 10,我为我的软件创建了一个 rpm 文件。它从安装的目录中删除所有文件。如果我使用 yum remove 命令或 rpm -e 命令。但安装后我的应用程序会自动在主目录中创建一些额外的文件夹。如果我卸载应用程序,则主目录中的文件不会被删除。所以我必须做什么。我的规范文件中有什么需要写的吗?

I am using Fedora 10, I have created an rpm file for my software. It removes all the files from the installed directory. If i use yum remove command or rpm -e command. but after installation my application automatically creates some extra folders in home directory. If I uninstall my application then file from home directories do not get removed. So what I have to do. Is there anything that I have to write in my spec file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初见 2024-08-18 01:39:36

您需要在 rpm 内创建卸载后脚本。

%postun 脚本

%postun 脚本在软件包被删除后执行。这是包自我清理的最后机会。通常,%postun 脚本用于运行 ldconfig 以从 ld.so.cache 中删除新删除的共享库。

请参阅:最大 RPM:将 Red Hat 软件包管理器发挥到极限

You need to create a post-uninstall script inside your rpm.

The %postun Script

The %postun script executes after the package has been removed. It is the last chance for a package to clean up after itself. Quite often, %postun scripts are used to run ldconfig to remove newly erased shared libraries from ld.so.cache.

See: Maximum RPM: Taking the Red Hat Package Manager to the Limit

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文