Debian 设置代理 apt-get (proxy)
Debian 设置代理 apt-get
方法一:有系统变量文件/etc/profile 里增加 export http_proxy=http://username:password@proxyIP:proxyPORT(或者ip地址+端口号)
方法二:有用户变量文件~/.bashrc 里增加上面那句,只对指定的用户生效。
方法三:修改/etc/apt/apt.conf 文件,如果没有这个文件可以新建一个 增加一句:
Acquire::http::Proxy "http://username:password@proxyIP:proxyPORT"; (或者ip地址+端口号)注意后面有一个分号。
输入 sudo apt-get update 测试
注意空格和符号。
顺便添加几个能访问的源
mv /etc/apt/sources.list /etc/apt/sources.list.bak ?(先备份)
echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list