apt uninstall 相关

原创
2021/11/25 16:26
阅读数 6

Debian/Ubuntu 系统中使用 apt 包管理工具删除软件

参考 https://www.linuxfordevices.com/tutorials/ubuntu/uninstalling-packages-with-apt

$ dpkg --list | grep <package-name>

查询通过 apt 工具已安装的相关软件

$ dpkg -l | grep kube
ii  kubeadm                              1.22.4-00                         amd64        Kubernetes Cluster Bootstrapping Tool
ii  kubectl                              1.22.4-00                         amd64        Kubernetes Command Line Tool
ii  kubelet                              1.22.4-00                         amd64        Kubernetes Node Agent
ii  kubernetes-cni                       0.8.7-00                          amd64        Kubernetes CNI

apt remove

删除 kubeadm kubectl kubelet kubernetes-cni 保留配置

$ apt remove kubeadm kubectl kubelet kubernetes-cni

apt purge

删除 kubeadm kubectl kubelet kubernetes-cni 不保留配置

$ apt purge kubeadm kubectl kubelet kubernetes-cni

remove 和 purge 的区别

What’s the difference between ‘remove‘ and ‘purge‘ ?
So the begging question here is ‘remove‘ and ‘purge‘ and when to use what ?

The primary difference being ‘remove‘ and ‘purge‘ is that ‘remove‘ only gets rid of the package leaving any configuration files untouched. Whereas ‘purge‘ not only removes the package but also removes all configuration files OUTSIDE THE HOME DIRECTORY.

清理缓存

  • 清理缓存的安装包
$ sudo apt clean
  • 清理无用的安装包
$ sudo apt autoreclean
  • 清理系统认为无用的软件和安装包
$ sudo apt autoremove
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部