apt命令集锦
在使用apt-get install [packege]安装多个包以后,最后追加上述命令,清除缓存中下载的包,系统环境洁癖。
1
| apt-get remove [package name]
|
1
| apt-get --purge remove [package name]
|
1
| sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
|
代理
只用一次
那就直接在命令上使用了, 就像这样:
1 2 3 4
| sudo apt -o Acquire::http::proxy="http://10.0.0.122:9090/" install vim sudo apt-get install -o Acquire::http::proxy="http://10.4.33.235:8888" curl sudo apt-get -o Acquire::http::proxy="http://10.4.33.235:8888" update
|
1
| export ALL_PROXY="socks5://192.168.1.1:8088"
|
如果需要设置 APT 走代理,需要修改 /etc/apt/apt.conf
:
1 2
| echo -e "Acquire::http::Proxy \"http://127.0.0.1:1090\";" | sudo tee -a /etc/apt/apt.conf > /dev/null echo -e "Acquire::https::Proxy \"http://127.0.0.1:1090\";" | sudo tee -a /etc/apt/apt.conf > /dev/null
|