Linux包系列的知识

原文链接: https://www.cnblogs.com/dunitian/p/9095641.html

简单讲:你不修改添加源,不需要updae,如果你想升级下软件upgrade,如果你想大升级dist-upgrade

在执行 upgrade or dist-upgrade 之前一定要执行 update, 这样才能获取最新

包相关命令:

# 清除无用包,一般用apt-get autoclean就够了
apt-get clean
apt-get autoclean

# 同步 /etc/apt/sources.list 源的索引,这样才知道是不是有最新的包
更新源:apt-get update

# 更新所有已安装的软件(upgrade只是简单的更新包,不管这些依赖,它不添不删。)
更新包:apt-get upgrade   

# 包与包之间存在各种依赖关系。而dist-upgrade可以根据依赖关系的变化添删包。(依赖有时会出错,建议新手谨慎使用)
更新包2:apt-get dist-upgrade 

# --reinstall 是重新安装包,一般都是用 apt-get install XXX
安装软件:apt-get install XXX [--reinstall] 

#修复依赖,类似于win里面的缺少dll,-f之后他帮你修复安装一些依赖(安装搜狗拼音实例有用到)
修复依赖:apt-get -f install       

# --purge 卸载的时候把配置文件也删了,完全删除包可以用这个选项:apt-get remove XXX --purge
删除软件:apt-get remove XXX [--purge] 

其他命令:(特殊环境下使用)

# 搜索软件
apt-get search xxx

# 检查是否有损坏的依赖,(偶尔想起来或者软件打不开的时候使用【有时候被清理了】)
apt-get check   

# 获取包信息:
apt-cache show xxx

# 有哪些依赖,(比如安装一个包,修复依赖也失败,那就看看有哪些依赖,自己手动安装)
apt-cache depends xxx

# 被哪些包依赖,(比如卸载一个包的时候,查一下被哪些包依赖)
apt-cache rdepends xxx

# 下载该包源代码:
apt-get source xxx

# 安装相关编译环境:
apt-get build-dep xxx
发布了19 篇原创文章 · 获赞 2 · 访问量 6574

猜你喜欢

转载自blog.csdn.net/feyehong/article/details/83721288