ubuntu apt-get 使用代理设置,坑爹。。
2013-08-19 18:18
513 查看
网上流传的export http_proxy=http://yourproxyaddress:proxyport是行不通的,虽然改了之后wget一类的可以用。当然去改.bashrc也不会有效果。
真正的解决方法如下:
新建文件 apt_proxy_conf(文件名任意)
内容如下:
往后就可以在apt-get之后加上 -c apt_proxy_conf 来执行。
更改源的步骤如下:
附录为Ubuntu 12.04在sohu的mirror(/etc/apt/source.list):
deb http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
真正的解决方法如下:
新建文件 apt_proxy_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之后加上 -c apt_proxy_conf 来执行。
更改源的步骤如下:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo vi /etc/apt/sources.list
sudo apt-get update
附录为Ubuntu 12.04在sohu的mirror(/etc/apt/source.list):
deb http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
相关文章推荐
- 【Ubuntu14.04.1】设置代理以使用Apt-get命令
- ubuntu apt-get 代理设置 使用代理设置源(使用代理更新Ubuntu的方法)
- 为apt-get设置HTTP代理(使用代理更新Ubuntu的方法)
- 第三章:hadoop安装配置,jps命令不能使用。apt-get命令不能下载jdk,缺少依赖包,设置静态ip后不能上网,ubuntu防火墙,ssh无密码登录
- Ubuntu下apt-get的网络代理设置(终端命令行的网络代理设置)
- ubuntu中apt-get设置网络代理
- Ubuntu 的 apt-get 代理设置
- Ubuntu的apt-get代理设置
- Ubuntu的apt-get代理设置
- Ubuntu下apt-get的网络代理设置(终端命令行的网络代理设置)
- ubuntu apt-get 代理设置
- Ubuntu 代理上网设置(firefox,新立得,apt-get等)
- 转载:Ubuntu 的 apt-get 代理设置
- Ubuntu下apt-get的代理设置
- Ubuntu 代理上网设置(firefox,新立得,apt-get等)
- Ubuntu apt-get代理设置
- [zz]ubuntu下为apt-get设置代理
- 给Ubuntu的apt-get设置代理
- Ubuntu 代理上网设置(firefox,新立得,apt-get等)