良许Linux教程网 干货合集 不同Linux发行版卸载安装包具体方法

不同Linux发行版卸载安装包具体方法

本篇文章主要为大家分享一下不同Linux发行版如果如何通过命令行卸载安装包,本篇使用的发行版本时目前最流行的几个,下面为大家详细讲解一下不同Linux发行版卸载安装包具体方法。

img

环境

  • Ubuntu 18.04 LTS
  • ArchLinux
  • Alpine
  • Fedora
  • OpenSUSE
  • Centos 7

Ubuntu/Debian卸载程序包

使用apt 列出已经安装的程序包:

bob@c14f840ed725:~$ sudo apt list --installed

Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包 也可以使用dpkg命令查找已安装的程序包:

bob@c14f840ed725:~$ dpkg -l|grep 'ftp'

Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包 下面我们卸载程序包:

可以使用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 ~]#

Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包 删除安装包:

[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 vsftpdvsftpd 3.0.3-6或者[root@d201bac103e8 /]# pacman -Q |grep vsftpdvsftpd 3.0.3-6

Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包 卸载安装包:

[root@d201bac103e8 /]# pacman -R vsftpdchecking dependencies...Packages (1) vsftpd-3.0.3-6Total 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...
Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包
Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包

OpenSUSE/SUSE卸载程序包

在OpenSUSE/SUSE中使用zypper包管理器进行管理安装包,下面查看是否安装vsftpd:

23d5ed5dcfc2:/ # zypper packages --installed-only |grep vsftpdi+ | OSS Update | vsftpd                            | 3.0.2-28.1                      | x86_64v  | OSS Update | vsftpd                            | 3.0.2-25.1                      | x86_64v  | OSS        | vsftpd                            | 3.0.2-23.1                      | x86_64或者23d5ed5dcfc2:/ # rpm -qa|grep vsftpdvsftpd-3.0.2-28.1.x86_64

Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包 卸载安装包:

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
Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包
Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包

Alpine Linux卸载程序包

在Alpine Linux中使用apk包管理器进行包管理,下面查看是否安装vsfptd:

# apk list -I |grep vsftpd

Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包 -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
Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包
Linux如何使用命令行卸载安装包Linux如何使用命令行卸载安装包

总结

想要了解更多关于包管理器的操作可以使用man yum,man dnf,man apt,man apk,man zypper,man pacman

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

img
本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部