`

在Ubuntu用代理使用apt-get命令

阅读更多
现在许多公司都有自己的代理服务器来控制员工上网。对用我们使用Linux系统,如Ubuntu,更新软件就会有一定的障碍。

在Ubuntu下,如果你想通过代理来访问apt-get上的源,可以修改或者添加一个/etc/apt/apt.conf文件

sudo vi /etc/apt/apt.conf


然后在文件中添加内容如下:

Acquire::http::proxy "http://127.0.0.1:8000/";
Acquire::ftp::proxy "ftp://127.0.0.1:8000/";
Acquire::https::proxy "https://127.0.0.1:8000/";


这样就可以使用代理服务器访问apt-get上的源了。

要想编辑源的列表,可以修改

vi /etc/apt/sources.list


deb http://cn.archive.ubuntu.com/ubuntu/ raring main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ raring main restricted


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics