环境
Ubuntu 18.04 LTS
ArchLinux
Alpine
Fedora
OpenSUSE
Centos 7
Ubuntu/Debian卸载程序包
使用apt 列出已经安装的程序包:
bob@c14f840ed725:~$ sudo apt list --installed
也可以使用dpkg命令查找已安装的程序包:
bob@c14f840ed725:~$ dpkg -l|grep 'ftp'
下面我们卸载程序包:
可以使用apt或者apt-get来卸载
bob@c14f840ed725:~$ sudo apt remove vsftpd
或者
bob@c14f840ed725:~$ sudo apt-get remove vsftpd
bob@c14f840ed725:~$ sudo apt remove --purge vsftpd
或者
bob@c14f840ed725:~$ sudo apt-get remove --purge vsftpd
添加–purge选项,指的是卸载是把程序包的配置文件也删掉。
检验一下安装包是否安装:
bob@c14f840ed725:~$ apt list --installed |grep vim
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
vim/bionic-updates,bionic-security,now 2:8.0.1453-1ubuntu1.3 amd64 [installed]
vim-common/bionic-updates,bionic-security,now 2:8.0.1453-1ubuntu1.3 all [installed,automatic]
vim-runtime/bionic-updates,bionic-security,now 2:8.0.1453-1ubuntu1.3 all [installed,automatic]
或者
bob@c14f840ed725:~$ dpkg -l|grep vim
ii vim 2:8.0.1453-1ubuntu1.3 amd64 Vi IMproved - enhanced vi editor
ii vim-common 2:8.0.1453-1ubuntu1.3 all Vi IMproved - Common files
ii vim-runtime 2:8.0.1453-1ubuntu1.3 all Vi IMproved - Runtime files
RHEL/CentOS卸载程序包
我们可以使用先的命令查看所有已经安装的程序包:
[root@qdzabbix ~]# yum list installed
或者
[root@qdzabbix ~]# rpm -qa
也可以查看某个程序包是否安装:
[root@qdzabbix ~]# yum list installed |grep vsftpd
vsftpd.x86_64 3.0.2-25.el7 @base
或者
[root@qdzabbix ~]# rpm -qa|grep vsftpd
vsftpd-3.0.2-25.el7.x86_64
[root@qdzabbix ~]#
删除安装包:
[root@qdzabbix ~]# yum -y remove vsftpd
Fedora卸载程序包
Fedora上面也可以用yum也可以使用dnf管理器,推荐使用dnf安装、卸载程序包:
#查看是否安装vsftpd
[root@716bc12a2197 ~]# rpm -qa|grep vsftpd
#或者
[root@716bc12a2197 ~]# dnf list installed |grep vsftpd
卸载vsftpd:
[root@716bc12a2197 ~]# dnf remove -y vsftpd
Arch Linux卸载程序包
Arch Linux中使用pacman包管理器:
#查询是否安装vsftpd
[root@d201bac103e8 /]# pacman -Q vsftpd
vsftpd 3.0.3-6
或者
[root@d201bac103e8 /]# pacman -Q |grep vsftpd
vsftpd 3.0.3-6
卸载安装包:
[root@d201bac103e8 /]# pacman -R vsftpd
checking dependencies...
Packages (1) vsftpd-3.0.3-6
Total Removed Size: 0.34 MiB
:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing vsftpd [########################################] 100%
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
Skipped: Current root is not booted.
(2/2) Arming ConditionNeedsUpdate...
OpenSUSE/SUSE卸载程序包
在OpenSUSE/SUSE中使用zypper包管理器进行管理安装包,下面查看是否安装vsftpd:
23d5ed5dcfc2:/ # zypper packages --installed-only |grep vsftpd
i+ | OSS Update | vsftpd | 3.0.2-28.1 | x86_64
v | OSS Update | vsftpd | 3.0.2-25.1 | x86_64
v | OSS | vsftpd | 3.0.2-23.1 | x86_64
或者
23d5ed5dcfc2:/ # rpm -qa|grep vsftpd
vsftpd-3.0.2-28.1.x86_64
卸载安装包:
23d5ed5dcfc2:/ # zypper remove vsftpd
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following package is going to be REMOVED:
vsftpd
1 package to remove.
After the operation, 320.9 KiB will be freed.
Continue? [y/n/...? shows all options] (y): y
(1/1) Removing vsftpd-3.0.2-28.1.x86_64 ........................................................................[done]
Additional rpm output:
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
Alpine Linux卸载程序包
在Alpine Linux中使用apk包管理器进行包管理,下面查看是否安装vsfptd:
~ # apk list -I |grep vsftpd
-I只列出已经安装的安装包。
卸载安装包:
~ # apk del vsftpd
(1/3) Purging vsftpd (3.0.3-r6)
(2/3) Purging libcap (2.27-r0)
(3/3) Purging linux-pam (1.3.1-r1)
Executing busybox-1.31.1-r9.trigger
OK: 6 MiB in 14 packages