如何使用rpm删除一些额外的文件夹

时间:2023-01-01 17:08:22

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?

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

1 个解决方案

#1


4  

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

您需要在rpm中创建一个卸载后脚本。

The %postun Script

% postun脚本

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.

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

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

参见:最高转速:将Red Hat包管理器发挥到极限

#1


4  

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

您需要在rpm中创建一个卸载后脚本。

The %postun Script

% postun脚本

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.

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

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

参见:最高转速:将Red Hat包管理器发挥到极限