在使用阿里云的时候,发现在添加saltstack的时候解析的不对,所以怀疑是服务器做了apt-get代理了,所以检查以下文件:
/etc/apt/apt.conf
发现里面内容为:
Acquire::http::Proxy "http://mirrors.aliyun.com/";
将其注释即可
当然做apt-get使用代理也可以反着上面的操作即可,有三种方法可以做代理
第一种:
export http_proxy=http://mirrors.aliyun.com
第二种:
vim /etc/apt/apt.conf
在您的apt.conf文件中加入下面这行(根据你的实际情况替换yourproxyaddress和proxyport)。
Acquire::http::Proxy “http://mirrors.aliyun.com”;
第三种:
在您的.bashrc文件末尾添加如下内容(根据你的实际情况替换yourproxyaddress和proxyport)。
http_proxy=http://mirrors.aliyun.com
export http_proxy
然后执行apt-get update
在执行的适合又发现这个问题
E: Unable to parse package file /var/lib/apt/lists/mirrors.aliyuncs.com_ubuntu_dists_trusty_main_i18n_Translation-en%5fUS (1)
E: The package lists or status file could not be parsed or opened.
只需吧这个文件删掉即可(rm掉)