跳转至

apt


更新于 2022-01-20

不安装推荐

Bash
1
sudo apt install --no-install-recommends --no-upgrade xxx

apt代理更新

Bash
1
sudo apt -o Acquire::http::proxy="http://ip:port/" install software-name

安装特定版本软件

有时依赖会出现问题,已经安装的包需要依赖的等级高,
例如:
The following packages have unmet dependencies.
zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2ubuntu4) but 1:1.2.8.dfsg-2ubuntu4.1 is to be installed
E: Unable to correct problems, you have held broken packages.
修复如下:

Text Only
1
sudo apt install zlib1g=1:1.2.8.dfsg-2ubuntu4

离线包

Bash
1
2
3
4
#--download-only
sudo apt install xxx -d
#查看离线包
ll /var/cache/apt/archives