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

推荐订阅源

N
News and Events Feed by Topic
GbyAI
GbyAI
博客园 - Franky
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Full Disclosure
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
博客园 - 【当耐特】
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Project Zero
Project Zero
量子位
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
美团技术团队
Attack and Defense Labs
Attack and Defense Labs
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
罗磊的独立博客
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
S
SegmentFault 最新的问题
L
LINUX DO - 最新话题
Simon Willison's Weblog
Simon Willison's Weblog
爱范儿
爱范儿
博客园 - 聂微东
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
D
Docker

元吉的博客

参加了良品计划 2025 年的股东大会 接到了平野美宇打出的签名纪念乒乓球 松下笔记本 Panasonic Let’s note CF-SV1 初体验 博客更新:从 Hugo 转到 WordPress 2025 年秋漠河见闻 介绍我最近上线的社区网站「在留.jp」 在 macOS 上快速搭建 SQL 运行环境(以 MariaDB 和 PostgreSQL 为例) 博客更新:头部及分享图显示头像等 斥资 1283 日元定制了一个新头像
Arch、Debian 包管理工具常用命令速查表
yuanji · 2025-02-09 · via 元吉的博客

コンテンツへスキップ

两个显示器在黑暗的服务器机房中,左侧显示蓝色的未来感数据界面,右侧显示 Linux 终端桌面。 技术

这篇文章大约需要3分钟阅读。

最近渐渐给一些不太想频繁更新的设备安装上了 Debian 系统,简单了解了一些 Debian 的运维知识。

和其他发行版一样,日常最常用的命令果然还是软件包管理。一直以来不管是电脑还是服务器都使用 Arch Linux 的我多少有一些不太熟悉,于是准备借此机会做一个常用包管理命令的速查表,方笔查阅。

安装软件包前

ArchDebian
同步软件包仓库pacman -Syapt update
同步软件包文件数据库pacman -Fyapt-file update
搜索软件包pacman -Ss <keyword>apt search <keyword>
搜索软件包(是否包含某文件)pacman -F <filename>
pacman -Fx <keyword>
apt-file search <keyword>
查看软件包信息pacman -Si <package>apt show -a <package>
apt-cache madison <package>

安装软件包

为了避免软件依赖产生的问题,建议在全量更新系统后安装新软件。

ArchDebian
更新系统(安装所有可用更新)pacman -Syuapt upgrade
安装软件包pacman -S <package>apt install <package>
安装特定版本软件包apt install <package>=<version>
安装 backports 里的软件包apt install -t <target>-backports <package>
安装本地软件包pacman -U /path/to/package.pkg.tar.zstapt install /path/to/package.deb

安装软件包后

ArchDebian
查看所有已安装软件包pacman -Qapt list --installed
查看特定已安装软件包pacman -Qi <package>dpkg -s <package>
查看已安装软件包提供的文件pacman -Ql <package>dpkg -L <package>
查看哪个软件包提供特定文件pacman -Qo /path/to/filedpkg -S /path/to/file
查看可升级软件包pacman -Quapt list --upgradable
删除软件包及依赖pacman -Rs <package>apt remove <package>
apt autoremove

参考链接