一、包管理器安装的软件
yum
yum remove package_name
这个命令会自动查找并删除指定软件包的可执行文件、所有依赖文件。
二、编译安装的软件
2.1 make uninstall
某些软件的作者考虑很周到,特意编写了卸载程序,会在./configure
时生成,这种软件可以用make uninstall
删除,如果最初的编译文件夹被删除了,还可以重新下载、编译,然后删除,例如:
wget imagemagick.org/download/ImageMagick.tar.gz
tar xf ImageMagick.tar.gz
cd ImageMagick-6.8.2-10
./configure
make uninstall
2.2 通过checkinstall
管理编译安装过程
CheckInstall的官方简介
A lot of people has asked me how can they remove from their boxes a program they compiled and installed from source. Some times — very few — the program's author adds an uninstall rule to their Makefile, but that's not usually the case. This is my primary reason to write CheckInstall.
作者说的很清楚,CheckInstall生来就是为了方便的删除从源代码编译安装的软件。
使用checkinstall
编译安装
./configure
make
checkinstall
CheckInstall会完成以下任务:
- 调用
make install
,然后用installwatch
监视、记录整个安装过程中添加的文件 - 等到安装完成,把记录的文件打包,根据不同的系统创建安装包:
.rpm
或.deb
- 注:安装包会保存在源代码目录,以便复制到其它机器安装,省去重复编译的麻烦。
- 移除
make install
安装的文件 - 调用系统安装工具来安装第2步创建的安装包:
rpm -i
或dpkg -i
卸载checkinstall
安装的软件
- CentOS:
rpm -e package_name
- Ubuntu:
dpkg -r package_name
更详细的CheckInstall资料
-
IBM网站上的中文教程,图文并茂(推荐):
https://www.ibm.com/developerworks/cn/linux/l-cn-checkinstall/index.html -
Ask Ubuntu的网友推荐使用CheckInstall管理编译安装的软件:
https://askubuntu.com/questions/87111/if-i-build-a-package-from-source-how-can-i-uninstall-or-remove-completely -
Ubuntu官网对CheckInstall的介绍:
https://help.ubuntu.com/community/CheckInstall
Leave A Comment