由於我國強大的GFW,致使不少國外的應用沒法安裝,由於須要在系統中配置http/https代理。ubuntu
Ubuntu代理配置bash
配置方式很是簡單,在~/.bashrc文件中增長:curl
echo "export http_proxy=proxy.aliyun.com:3128" >> ~/.bashrc echo "export ftp_proxy=proxy.aliyun.com:3128" >> ~/.bashrc echo "export https_proxy=proxy.aliyun.com:3128" >> ~/.bashrc echo "no_proxy='172.16.65.0/24,localhost,127.0.0.1'" >> ~/.bashrc # 排除本地網段 root@ubuntu:~# source ~/.bashrc
以上配置只能使用wget curl等使用。apt-get就不會報錯,提示沒法鏈接到代理,須要再作以下配置:ui
echo 'Acquire::http::Proxy "http://proxy.aliyun.com:3128";' >> /etc/apt/apt.conf
echo 'Acquire::ftp::Proxy "http://proxy.aliyun.com:3128";' >> /etc/apt/apt.conf
echo 'Acquire::https::Proxy "http://proxy.aliyun.com:3128";' >> /etc/apt/apt.conf
Centos配置url
echo "export http_proxy=proxy.aliyun.com:3128" >> /etc/profile echo "export https_proxy=proxy.aliyun.com:3128" >> /etc/profile source /etc/profile
MAC OS配置spa
$ export http_proxy=proxy.aliyun.com:8080$ export https_proxy=proxy.aliyun.com:8080