ITeye博客

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

evil850209 · 2013-08-05 14:48 · Linux · 操作系统 · Ubuntu · Linux · Markdown

现在许多公司都有自己的代理服务器来控制员工上网。对用我们使用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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。