centos6.9终端设置代理访问外网络

本文永久地址:https://my.oschina.net/bysu/blog/1359109

由于公司网络需要用到代理,才能对外网进行访问。不设置外网进行yum访问,会报如下错误:

[subaoya@localhost ]$ sudo yum groupinstall "Development tools"
Loaded plugins: fastestmirror,refresh-packagekit,security
Setting up Group Process
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

yum proxy

  • 文件目录
vim /etc/yum.conf
  • 添加如下
proxy = http://[username:password@]yourproxy:8080/

参考:http://www.cnblogs.com/zjoch/p/6509925.html

本文永久地址:https://my.oschina.net/bysu/blog/1359109

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim /etc/sysconfig/network-scripts/ifcfg-eth0 B...