ubuntu 删除容器内没用的包
2024-10-20 21:01:55
- 删除多余 apt 包
这些就是依赖的所有动态链接库,接着我们将这些包用 apt-mark 声明为“手工安装的包”,即可阻止 apt purge 的自动卸载。
然后,我们再自动卸载其余没有用到的包即可。完整shell脚本如下:find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; - 删除容器内 python2
apt-get remove --auto-remove python2.7
apt-get purge --auto-remove python2.7
apt-get autoclea python2.7 whereis python2 # 查看是否存在python2
whereis python2 |xargs rm -frv # 删除python2所有残余文件
https://zhuanlan.zhihu.com/p/526332103
最新文章
- CSharpGL(8)使用3D纹理渲染体数据 (Volume Rendering) 初探
- Spring MVC如何配置OpenSessionInViewInterceptor并结合Hibernate使用
- 安装percona-xtrabackup一直提示依赖冲突的一个解决办法
- CI(CodeIgniter)框架介绍
- ZOJ3471--Most Powerful(状压DP)
- C#垃圾回收机制详解
- ie中弹出框中元素的定位
- JavaSE复习日记 : 方法的调用和方法的重载
- GDB学习之道:GDB调试精粹及使用实例
- Android4.0设置接口变更摘要(四)
- CenOS http 安装与运行
- Mysql创建、删除用户、用户管理等相关:转载http://www.cnblogs.com/fly1988happy/archive/2011/12/15/2288554.html
- wordpress主题
- 距离不是一个连续的物理量(Distance is not a continuous physical quantity)
- 添加用户到sudoers
- Confluence 6 数据库整合的方法 1:基本流程
- 建筑的永恒之道 (C·亚历山大 著)
- (一)apache atlas源代码编译与打包
- LintCode: Longest Words
- git 常用命令总结(一)