首先查看下这个目录里有没有Centos-Base.repo这个文件(附件里有这个)
然后用Xmanager下的xftp 把本机上的这个文件复制到虚拟机中的/目录下
[root@fox ~]# mv Centos-Base.repo /etc/yum.repos.d/
[root@fox ~]# cd /etc/yum.repos.d/
[root@fox yum.repos.d]# ls
Centos-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo 剪切过去 查看这个目录 里面出现这个文件
然后执行
[root@fox yum.repos.d]# yum clean all
[root@fox yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, refresh-packagekit
Determining fastest mirrors
* base: mirrors.btte.net
* extras: mirrors.btte.net
* updates: mirrors.btte.net
base | 3.7 kB 00:00
base/group_gz | 220 kB 00:00
base/filelists_db | 5.9 MB 00:02
base/primary_db | 4.4 MB 00:02
base/other_db | 2.8 MB 00:01
extras | 3.3 kB 00:00
extras/filelists_db | 11 kB 00:00
extras/prestodelta | 904 B 00:00
extras/primary_db | 19 kB 00:00
extras/other_db | 22 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 3.0 MB 00:00
updates/prestodelta | 535 kB 00:00
updates/primary_db | 5.4 MB 00:02
updates/other_db | 46 MB 00:26
Metadata Cache Created
这2条命令 会提示下载安装包组件
然后就可以安装nano啦!!!
[root@fox ~]# yum install nano
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* extras: mirrors.btte.net
* updates: mirrors.btte.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nano.x86_64 0:2.0.9-7.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
nano x86_64 2.0.9-7.el6 base 436 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 436 k
Installed size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
nano-2.0.9-7.el6.x86_64.rpm | 436 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : nano-2.0.9-7.el6.x86_64 1/1
Verifying : nano-2.0.9-7.el6.x86_64 1/1
Installed:
nano.x86_64 0:2.0.9-7.el6
Complete!
红色的是主要命令 不会的小伙伴可以试试 , 我用的是CentOS 6.5 64位的