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

推荐订阅源

K
Kaspersky official blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
Martin Fowler
Martin Fowler
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
V
Vulnerabilities – Threatpost
云风的 BLOG
云风的 BLOG
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
量子位
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
Intezer
Scott Helme
Scott Helme
A
About on SuperTechFans
博客园 - 司徒正美
Hacker News: Ask HN
Hacker News: Ask HN
The GitHub Blog
The GitHub Blog
Forbes - Security
Forbes - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Spread Privacy
Spread Privacy
T
Tailwind CSS Blog
S
Security Affairs
宝玉的分享
宝玉的分享

元吉的博客

参加了良品计划 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

参考链接