在linux里安装程序有两种方法,一种是源程序安装,按照安装包里的readme或者install文件指示,一步步地进行,通常是configure,
make, install三部曲。另一种就是rpm包,这个类似windows里常见的安装程序,既可在xwin里双击运行,也可以在终端里输入
rpm -ivh packagename开始安装。
卸装时,用源程序安装的运行make uninstall, 用rpm安装的则仍是使用rpm。
对于接触linux不久的我来说,总感觉这些过程挺麻烦的,时不时会遇到点问题。
今天卸载rpm的时候,就出了一点岔子,记录下来以为后鉴。
提示错误"error: %preun(wine-20050310-1fc1winehq) scriptlet failed, exit status 1”
经搜索,其解决方法为加 --noscripts 标记来删除RPM。 --noscripts 相当于 --nopre --nopost
--nopreun --nopostun。
即卸载命令变为:
$rpm -e --noscripts wine-20050310-1fc1winehq
若要查看与RPM关联的scripts,使用--script查询RPM包。
$rpm -q --scripts package
卸载时,若系统里有同一程序的多个安装版本要一起删除,可使用--allmatches标记,如
$ rpm -e --noscripts --allmatches vsftpd
卸载成功后,重新安装新的wine包 $rpm -ivh vsftpd-2.3.4-5.1.3.x86_64rpm.
参考资料:
https://rpmfind.net/linux/rpm2html/
https://techmesrv.weebly.com/yum-errors/yum-package-removal-error-error-in-preun-scriptlet-in-rpm-package