ubuntu apt-get 使用代理設置,坑爹。。

網上流傳的export http_proxy=http://yourproxyaddress:proxyport是行不通的,雖然改了以後wget一類的能夠用。固然去改.bashrc也不會有效果。ubuntu

真正的解決方法以下:bash

新建文件 apt_proxy_conf(文件名任意)ui

內容以下:spa

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 來執行。rest

 

更改源的步驟以下:ci

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):get

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 multiverseit

相關文章
相關標籤/搜索