linux mini模式下如何制作本地yum源,并用远程工具安装 vim
打开虚拟机
启动centos 系统
点右下角的光盘图标
出现连接(或是断开)、设置,下拉菜单,选择 “设置”
在虚拟机设置对话框内如图所示
[[email protected] ~]# vim
-bash: /usr/bin/vim: 没有那个文件或目录
光盘挂载:
查看系统中所有的挂载信息
[[email protected] ~]# mount
/dev/sda3 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
[[email protected] ~]# mount /dev/sr0 /mnt/cdrom
mount: block device /dev/sr0 is write-protected, mounting read-only
只读
[[email protected] ~]# mount
/dev/sda3 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sr0 on /mnt/cdrom type iso9660 (ro)
#iso9660表示光盘已挂载
[[email protected] ~]#
[[email protected] ~]# vim
-bash: /usr/bin/vim: 没有那个文件或目录
[[email protected] ~]# ifconfig
设置yum
[[email protected] ~]# cd /etc/yum.repos.d
#进入目录yum.repos.d
[[email protected] yum.repos.d]# ll
总用量 16
-rw-r--r--. 1 root root 1926 11月 27 2013 CentOS-Base.repo
-rw-r--r--. 1 root root 638 11月 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 628 4月 28 02:17 CentOS-Media.repo
-rw-r--r--. 1 root root 3664 11月 27 2013 CentOS-Vault.repo
[[email protected] yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
把CentOS-Base.repo文件名改为 CentOS-Base.repo.bak
[[email protected] yum.repos.d]# ll
列出当前目录下文件
总用量 16
-rw-r--r--. 1 root root 1926 11月 27 2013 CentOS-Base.repo.bak
-rw-r--r--. 1 root root 638 11月 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 628 4月 28 02:17 CentOS-Media.repo
-rw-r--r--. 1 root root 3664 11月 27 2013 CentOS-Vault.repo
[[email protected] yum.repos.d]# vi CentOS-Media.repo
[[email protected] yum.repos.d]# yum -y install vim
以下是安装过程所显示的信息
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.i686 2:7.2.411-1.8.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================
Package Arch Version Repository Size
==============================================================================
Installing:
vim-enhanced i686 2:7.2.411-1.8.el6 c6-media 837 k
Transaction Summary
==============================================================================
Install 1 Package(s)
Total download size: 837 k
Installed size: 1.8 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 2:vim-enhanced-7.2.411-1.8.el6.i686 1/1
Verifying : 2:vim-enhanced-7.2.411-1.8.el6.i686 1/1
Installed:
vim-enhanced.i686 2:7.2.411-1.8.el6
Complete!
vim 安装成功