linux_apt 卸载清理/包检查/完整包名查询/清理已经下载的包缓存(被打断的下载)/remove/purge/autoremove/autoclean

本文主要是介绍linux_apt 卸载清理/包检查/完整包名查询/清理已经下载的包缓存(被打断的下载)/remove/purge/autoremove/autoclean,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

  • linux_apt 卸载清理
    • apt 清理相关命令
      • 示例(卸载与清理)
      • purge and autoremove
      • for example:
    • 一步到位(sudo apt --purge autoremove)
    • 逐步操作
    • Remove a package:(step by step)
      • Get the package complete name:(完整包名查询)
    • 清理apt下载的包缓存

linux_apt 卸载清理

  • uninstall - How can you completely remove a package? - Ask Ubuntu
  • 技术|如何清除 APT 缓存来回收宝贵的磁盘空间 (linux.cn)

apt 清理相关命令

  • 卸载某个包(apt remove)

  • apt autoremove

    • 清理依赖

    • autoremove (apt-get(8))autoremove is used to remove packages that were automatically installed tosatisfy dependencies for other packages and are now no longer needed asdependencies changed or the package(s) needing them were removed in themeantime.
      

示例(卸载与清理)

# cxxu_kali @ CxxuWin11 in ~ [20:09:02]
$ sudo apt list --installed|grep python
libpython3.9-dev/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
libpython3.9-minimal/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
libpython3.9-stdlib/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
libpython3.9/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
python3-dev/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]
python3-distutils/kali-rolling,now 3.9.10-1 all [installed,automatic]
python3-lib2to3/kali-rolling,now 3.9.10-1 all [installed,automatic]
python3-minimal/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]
python3-pip/kali-rolling,now 22.0.2+dfsg-1 all [installed]
python3-pkg-resources/kali-rolling,now 59.6.0-1.2 all [installed,automatic]
python3-setuptools/kali-rolling,now 59.6.0-1.2 all [installed,automatic]
python3-wheel/kali-rolling,now 0.37.1-2 all [installed,automatic]
python3.10-minimal/kali-rolling,now 3.10.2-1 amd64 [installed,auto-removable]
python3.9-dev/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
python3.9-minimal/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
python3.9/kali-rolling,now 3.9.12-1 amd64 [installed]
python3/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]# cxxu_kali @ CxxuWin11 in ~ [20:09:15]
$ sudo apt autoclean
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Del git-man 1:2.34.1-1 [1,903 kB]
Del git 1:2.34.1-1 [5,738 kB]
Del libcurl3-gnutls 7.81.0-1 [353 kB]
Del libexpat1 2.4.4-1 [106 kB]
Del openssh-client 1:8.8p1-1 [1,040 kB]# cxxu_kali @ CxxuWin11 in ~ [20:10:47]
$ sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:libpython3.10-minimal libpython3.10-stdlib python3.10-minimal
0 upgraded, 0 newly installed, 3 to remove and 109 not upgraded.
After this operation, 19.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 39390 files and directories currently installed.)
Removing libpython3.10-stdlib:amd64 (3.10.2-1) ...
Removing python3.10-minimal (3.10.2-1) ...
Unlinking and removing bytecode for runtime python3.10
Removing libpython3.10-minimal:amd64 (3.10.2-1) ...
Processing triggers for man-db (2.10.2-1) ...# cxxu_kali @ CxxuWin11 in ~ [20:10:58]
$ sudo apt autoremove# cxxu_kali @ CxxuWin11 in ~ [20:11:15] C:130
$ sudo apt list --installed|grep pythonWARNING: apt does not have a stable CLI interface. Use with caution in scripts.libpython3-dev/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]
libpython3-stdlib/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]
libpython3.9-dev/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
libpython3.9-minimal/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
libpython3.9-stdlib/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
libpython3.9/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
python3-dev/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]
python3-distutils/kali-rolling,now 3.9.10-1 all [installed,automatic]
python3-lib2to3/kali-rolling,now 3.9.10-1 all [installed,automatic]
python3-minimal/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]
python3-pip/kali-rolling,now 22.0.2+dfsg-1 all [installed]
python3-pkg-resources/kali-rolling,now 59.6.0-1.2 all [installed,automatic]
python3-setuptools/kali-rolling,now 59.6.0-1.2 all [installed,automatic]
python3-wheel/kali-rolling,now 0.37.1-2 all [installed,automatic]
python3.9-dev/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
python3.9-minimal/kali-rolling,now 3.9.12-1 amd64 [installed,automatic]
python3.9/kali-rolling,now 3.9.12-1 amd64 [installed]
python3/kali-rolling,now 3.9.8-1 amd64 [installed,automatic]# cxxu_kali @ CxxuWin11 in ~ [20:11:17]

purge and autoremove

This is a very general answer to the question about the effects of purging packages. For advice specific to your situation, you’ll have to edit your question to include additional information–in particular, the complete and exact text of the error message you are getting.*

Removing packages with sudo apt purge ***...\*** or sudo apt --purge remove ***...\*** will remove them and all their global (i.e., systemwide) configuration files. This is usually what people mean when they talk about completely removing a package.

But that doesn’t mean your system is the same as it was before the package was installed. In particular:

  • This does not remove packages that were installed as dependencies, when you installed the package you’re now removing. Assuming those packages aren’t dependencies of any other packages, and that you haven’t marked them as manually installed, you can remove the dependencies with sudo apt autoremove or (if you want to delete their systemwide configuration files too) sudo apt --purge autoremove.

for example:

  • try to remove python3.9 completely
# cxxu_kali @ CxxuWin11 in ~ [20:21:58]
$ sudo apt purge python3.9
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:javascript-common libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libmpdec3libpython3-dev libpython3-stdlib libpython3.9 libpython3.9-dev libpython3.9-minimallibpython3.9-stdlib media-types python3-minimal python3.9-minimal zlib1g-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:python3* python3-dev* python3-distutils* python3-lib2to3* python3-pip*python3-pkg-resources* python3-setuptools* python3-wheel* python3.9* python3.9-dev*
0 upgraded, 0 newly installed, 10 to remove and 109 not upgraded.
After this operation, 12.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 38760 files and directories currently installed.)
Removing python3-dev (3.9.8-1) ...
Removing python3-pip (22.0.2+dfsg-1) ...
Removing python3-wheel (0.37.1-2) ...
Removing python3-setuptools (59.6.0-1.2) ...
Removing python3-distutils (3.9.10-1) ...
Removing python3-pkg-resources (59.6.0-1.2) ...
Removing python3-lib2to3 (3.9.10-1) ...
dpkg: warning: while removing python3-lib2to3, directory '/usr/lib/python3.10' not empty so not removed
Removing python3.9-dev (3.9.12-1) ...
Removing python3 (3.9.8-1) ...
Removing python3.9 (3.9.12-1) ...
Processing triggers for man-db (2.10.2-1) ...
(Reading database ... 37530 files and directories currently installed.)
Purging configuration files for python3 (3.9.8-1) ...#remove the dependencies# cxxu_kali @ CxxuWin11 in ~ [20:22:11]
$ sudo apt list --installed|grep pythonWARNING: apt does not have a stable CLI interface. Use with caution in scripts.libpython3-dev/kali-rolling,now 3.9.8-1 amd64 [installed,auto-removable]
libpython3-stdlib/kali-rolling,now 3.9.8-1 amd64 [installed,auto-removable]
libpython3.9-dev/kali-rolling,now 3.9.12-1 amd64 [installed,auto-removable]
libpython3.9-minimal/kali-rolling,now 3.9.12-1 amd64 [installed,auto-removable]
libpython3.9-stdlib/kali-rolling,now 3.9.12-1 amd64 [installed,auto-removable]
libpython3.9/kali-rolling,now 3.9.12-1 amd64 [installed,auto-removable]
python3-minimal/kali-rolling,now 3.9.8-1 amd64 [installed,auto-removable]
python3.9-minimal/kali-rolling,now 3.9.12-1 amd64 [installed,auto-removable]

一步到位(sudo apt --purge autoremove)

适用于全新的卸载操作

  • sudo apt-get purge --auto-remove packagename

逐步操作

  • 之前未卸载干净时的清理
    • remove
    • purge
    • autoremove
    • autoclean

Remove a package:(step by step)

Get the package complete name:(完整包名查询)

dpkg --list | grep partial_package_name*
  • Remove the package:
sudo apt-get remove package_name
  • Remove all the dependencies:
sudo apt-get purge package_name
  • Remove the unneeded packages that were once installed as a dependency:
sudo apt-get autoremove
  • Remove the retrieved packages from the local cache:
sudo apt-get autoclean
  • Check that it was completely removed:
dpkg --list | grep partial_package_name*

清理apt下载的包缓存

  • cd /var/cache/apt/archives
    在这里插入图片描述
  • 在该目录下删除deb文件

这篇关于linux_apt 卸载清理/包检查/完整包名查询/清理已经下载的包缓存(被打断的下载)/remove/purge/autoremove/autoclean的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/211384

相关文章

linux-基础知识3

打包和压缩 zip 安装zip软件包 yum -y install zip unzip 压缩打包命令: zip -q -r -d -u 压缩包文件名 目录和文件名列表 -q:不显示命令执行过程-r:递归处理,打包各级子目录和文件-u:把文件增加/替换到压缩包中-d:从压缩包中删除指定的文件 解压:unzip 压缩包名 打包文件 把压缩包从服务器下载到本地 把压缩包上传到服务器(zip

常用的jdk下载地址

jdk下载地址 安装方式可以看之前的博客: mac安装jdk oracle 版本:https://www.oracle.com/java/technologies/downloads/ Eclipse Temurin版本:https://adoptium.net/zh-CN/temurin/releases/ 阿里版本: github:https://github.com/

活用c4d官方开发文档查询代码

当你问AI助手比如豆包,如何用python禁止掉xpresso标签时候,它会提示到 这时候要用到两个东西。https://developers.maxon.net/论坛搜索和开发文档 比如这里我就在官方找到正确的id描述 然后我就把参数标签换过来

Linux 网络编程 --- 应用层

一、自定义协议和序列化反序列化 代码: 序列化反序列化实现网络版本计算器 二、HTTP协议 1、谈两个简单的预备知识 https://www.baidu.com/ --- 域名 --- 域名解析 --- IP地址 http的端口号为80端口,https的端口号为443 url为统一资源定位符。CSDNhttps://mp.csdn.net/mp_blog/creation/editor

【Python编程】Linux创建虚拟环境并配置与notebook相连接

1.创建 使用 venv 创建虚拟环境。例如,在当前目录下创建一个名为 myenv 的虚拟环境: python3 -m venv myenv 2.激活 激活虚拟环境使其成为当前终端会话的活动环境。运行: source myenv/bin/activate 3.与notebook连接 在虚拟环境中,使用 pip 安装 Jupyter 和 ipykernel: pip instal

缓存雪崩问题

缓存雪崩是缓存中大量key失效后当高并发到来时导致大量请求到数据库,瞬间耗尽数据库资源,导致数据库无法使用。 解决方案: 1、使用锁进行控制 2、对同一类型信息的key设置不同的过期时间 3、缓存预热 1. 什么是缓存雪崩 缓存雪崩是指在短时间内,大量缓存数据同时失效,导致所有请求直接涌向数据库,瞬间增加数据库的负载压力,可能导致数据库性能下降甚至崩溃。这种情况往往发生在缓存中大量 k

Linux_kernel驱动开发11

一、改回nfs方式挂载根文件系统         在产品将要上线之前,需要制作不同类型格式的根文件系统         在产品研发阶段,我们还是需要使用nfs的方式挂载根文件系统         优点:可以直接在上位机中修改文件系统内容,延长EMMC的寿命         【1】重启上位机nfs服务         sudo service nfs-kernel-server resta

【Linux 从基础到进阶】Ansible自动化运维工具使用

Ansible自动化运维工具使用 Ansible 是一款开源的自动化运维工具,采用无代理架构(agentless),基于 SSH 连接进行管理,具有简单易用、灵活强大、可扩展性高等特点。它广泛用于服务器管理、应用部署、配置管理等任务。本文将介绍 Ansible 的安装、基本使用方法及一些实际运维场景中的应用,旨在帮助运维人员快速上手并熟练运用 Ansible。 1. Ansible的核心概念

Linux服务器Java启动脚本

Linux服务器Java启动脚本 1、初版2、优化版本3、常用脚本仓库 本文章介绍了如何在Linux服务器上执行Java并启动jar包, 通常我们会使用nohup直接启动,但是还是需要手动停止然后再次启动, 那如何更优雅的在服务器上启动jar包呢,让我们一起探讨一下吧。 1、初版 第一个版本是常用的做法,直接使用nohup后台启动jar包, 并将日志输出到当前文件夹n