惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

Kang

C/C++ 模板元编程学习 Ubuntu包管理 C/C++编译知识 如何使用 CMake vscode插件配置 MSVC,GCC,Clang——不同C/C++编译器对比 开源贡献的一些规范 Github Pages + Hexo 搭建个人博客 将光猫设置为桥接 Ubuntu安装记录 Shell
Ubuntu包管理
Yu Kang · 2024-08-01 · via Kang

APT

APT 是基于 Ubuntu/Debian 的 Linux 发行版上的默认包管理器。

常用命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 列出所有可更新的软件清单命令
sudo apt update
# 升级软件包
sudo apt upgrade
# 列出可更新的软件包及版本信息
apt list --upgradable
# 列出所有已安装的包
apt list --installed
# 列出所有已安装的包的版本信息
apt list --all-versions
# 安装指定的软件命令
sudo apt install <package_name>
# 更新指定的软件命令
sudo apt update <package_name>
# 显示软件包具体信息,例如:版本号,安装大小,依赖关系等等
sudo apt show <package_name>
# 删除软件包命令
sudo apt remove <package_name>
# 清理不再使用的依赖和库文件
sudo apt autoremove
# 移除软件包及配置文件
sudo apt purge <package_name>
# 查找软件包命令
sudo apt search <keyword>

软件包存储库

Ubuntu 软件包存储库信息存储在 /etc/apt/sources.list 文件中。第三方 PPA 和其他存储库作为 .list 文件存储在 /etc/apt/sources.list.d/ 目录中。

下面为 Ubuntu22.04LTS 的 /etc/apt/sources.list 文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://archive.ubuntu.com/ubuntu/ jammy universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb http://security.ubuntu.com/ubuntu/ jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security universe
deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security multiverse

deb-src deb

deb-src: 包含软件源代码、版本修改说明、构建指令以及编译工具等。允许用户下载软件包的源代码,从而可以自己编译软件。这通常用于开发者或那些需要定制软件包或需要最新开发版本的用户。

deb: 包含可执行文件、库文件、配置文件、man/info页面、版权声明和其它文档。提供了预先编译好的软件包,用户可以直接安装而无需自己编译。

jammy: Ubuntu22.04 代号

  • Ubuntu 18.04 LTS bionic

  • Ubuntu 20.04 LTS focal

  • Ubuntu 22.04 LTS jammy

  • Ubuntu 24.04 LTS noble

main restricted universe multiverse 软件包存储库

  • main: 保留了Ubuntu支持的自由和开源软件。

  • restricted: 保留专有驱动程序(即 NVIDIA)。

  • universe: 保留了社区维护的免费开源软件。

  • multiverse: 保留有版权限制或法律问题的软件。

jammy jammy-security jammy-backports jammy-updates jammy-proposed 不同分支

  • 基础:由于ubuntu是每6个月发行一个新版,当发行后,所有软件包的版本在这六个月内将保持不变,即使是有新版都不更新。除开重要的安全补丁外,所有新功能和非安全性补丁将不会提供给用户更新。  

  • security:仅修复漏洞,并且尽可能少的改变软件包的行为,低风险。

  • backports:backports 的团队则认为最好的更新策略是 security 策略加上新版本的软件(包括候选版本的),但不会由Ubuntu security team审查和更新。

  • updates:包含了针对特定版本的更新,这些更新是在原始版本发布之后提供的,可能包括安全修复、bug修复和一些较小的功能改进。  

  • proposed:updates类的测试部分,仅建议提供测试和反馈的人进行安装。

dpkg

dpkg是Debian的一个底层包管理工具,主要用于对已下载到本地和已安装的软件包进行管理。

常用命令:

1
2
3
4
5
dpkg -i <package>  # 安装一个在本地文件系统上存在的Debian软件包
dpkg -r <package> # 移除一个已经安装的软件包
dpkg -P <package> # 移除已安装软件包及配置文件
dpkg -L <package> # 列出安装的软件包清单
dpkg -s <package> # 显出软件包的安装状态

参考:

  1. 源中的 backports proposed security updates 的意思(已解决) - Ubuntu中文论坛

  2. Linux apt 命令 | 菜鸟教程 (runoob.com)

  3. Ubuntu 软件包管理工具 —— dkpg、apt(dpkg常用指令、apt 软件源的配置)-CSDN博客