linux学习——centos minimal安装vim

virtual box上安装完CentOS-6.4-i386-minimal.iso后系统是不带vim的。最简便的方法是通过yum工具安装,命令为:yum -y install vim。然而执行该命令后却提示错误:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6 ... 86&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base

大致意思为无法解析主机'mirrorlist.centos.org'。主要有几种可能性:

1) centos网络设置不正确

2) 'mirrorlist.centos.org网站有问题(可能性极小)

先排查下本地配置。

通过ifconfig查看网络配置,发现没有配置ip地址。查看网络配置文件/etc/sysconfig/network-scripts/ifcfg-eth0将ONBOOT特性修改为YES。

重启系统后执行yum -y install vim,vim安装成功。

原文地址:https://www.cnblogs.com/collapsar/p/3440720.html