解决代理上网中Linux下YUM无法使用推荐

背景:

公司的电脑是通过代理上网的,Vmware下一台Centos6.5_64的系统,网络模式为NAT。可以ping的通外网,但是yum安装东西总是报错,如下图

[root@test~]#yumlistLoadedplugins:fastestmirror,refresh-packagekit,securitySettingupRemoveProcessNoMatchforargument:mysql-serverLoadingmirrorspeedsfromcachedhostfileCouldnotretrievemirrorlistrelease=6 arch=x86_64 repo=os infra=stockerrorwas14:PYCURLERROR7-"Failedtoconnectto2a02:2498:1:3d:5054:ff:fed3:e91a:Networkisunreachable"Error:Cannotfindavalidbaseurlforrepo:base[root@test~]#

解决办法:

在宿主机上ping代理上网的网站获取IP地址

在Linux机器中做以下操作:

[root@test~]#vim/etc/profile[root@test~]#tail-3/etc/profileexporthttp_proxy=10.14.36.103:8080exporthttps_proxy=10.14.36.103:8080[root@test~]#source/etc/profile[root@test~]#yumcleanall

再执行yum

已解决!

人之相识,贵在相知;人之相知,贵在知心。

解决代理上网中Linux下YUM无法使用推荐

相关文章:

你感兴趣的文章:

标签云: