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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM