Ubuntu-软件环境的维护-[apt]
2021/9/5 7:08:58
本文主要是介绍Ubuntu-软件环境的维护-[apt],对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
[检查包的安装状态]
apt-cache policy + 包名
例如:
apt-cache policy python3.7-dev
输出:
python3.7-dev: Installed: 3.7.5-2~18.04.4 Candidate: 3.7.5-2~18.04.4 Version table: *** 3.7.5-2~18.04.4 500 500 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages 500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages 100 /var/lib/dpkg/status 3.7.0~b3-1 500 500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
*注意 version table 内容会根据系统apt设置的源的不同而不同,如果国内加速源与官方源同步较好,应当仅有域名和路径不同。version table 不应当作为记录安装的这个软件来自于哪个源的参考。
包溯源较为复杂,如果网络允许,开发基于大量三方开源组件的系统,最好一直用官方源,避免一些稀奇古怪的bug。
其他方法检查包的安装状态:
https://linux.cn/article-11010-1.html
[查找源上包的信息]:
输入:
sudo apt-get update
完成更新后:
apt-cache search 包名关键字|grep 子关键字1|grep 子关键字2|more
(可以用:子关键字|grep 子关键字 管道往后延,逐次添加关键字 来缩小搜索范围,|more 用来分页,屏幕够大可以不要more,有时候带有more的时候关键字不会高亮,高亮规则是grep管道最后的一个搜索关键字)
apt-cache search vlc|grep player|more
输出:
freeplayer - wrapper around vlc for French ADSL FreeBox freetuxtv - Internet television and radio player kaffeine - versatile media player for KDE libvlc5 - multimedia player and streamer library mpris-remote - command-line interface for mpris compatible media players streamlink - CLI for extracting video streams from various websites to a video player vlc - multimedia player and streamer vlc-plugin-access-extra - multimedia player and streamer (extra access plugins) vlc-plugin-base - multimedia player and streamer (base plugins) vlc-plugin-qt - multimedia player and streamer (Qt plugin) vlc-plugin-skins2 - multimedia player and streamer (Skins2 plugin) vlc-plugin-video-output - multimedia player and streamer (video output plugins) vlc-plugin-video-splitter - multimedia player and streamer (video splitter plugins) vlc-plugin-visualization - multimedia player and streamer (visualization plugins)
[安装一个包]:
sudo apt-get install 包名
sudo apt-get install vlc
交互中会包含:输入用户密码,在源上的检索日志,是否要安装指定的包 [y/n]
[删除一个包]
sudo apt-get purge vlc
删除不再需要的依赖项
sudo apt-get autoremove
其他需要注意的事项:
https://blog.csdn.net/get_set/article/details/51276609
这篇关于Ubuntu-软件环境的维护-[apt]的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-06-26结对编程到底难不难?答案在这里
- 2024-06-19《2023版Java工程师》课程升级公告
- 2024-06-15matplotlib作图不显示3D图,怎么办?
- 2024-06-1503-Loki 日志监控
- 2024-06-1504-让LLM理解知识 -Prompt
- 2024-06-05做软件测试需要懂代码吗?
- 2024-06-0514-ShardingSphere的分布式主键实现
- 2024-06-03为什么以及如何要进行架构设计权衡?
- 2024-05-31全网首发第二弹!软考2024年5月《软件设计师》真题+解析+答案!(11-20题)
- 2024-05-31全网首发!软考2024年5月《软件设计师》真题+解析+答案!(21-30题)