Centos 6 yum本地仓库的建立
[root@zh888 yum.repos.d]# ls //首先备份一下yum.repos.d目录文件到backup中然后创建vi yum.repo文件。
backup  yum.repo
[root@zh888 yum.repos.d]# cat yum.repo
[zh888]第一行:yum源的标签
name=zh888第二行:yum源的名称
baseurl=file:///mnt第三行:指定yum源的具体位置及路径
enable=1第四行:这个就好像是电源开关,也就是yum的开关,1为可用,等于0时不可用
gpgcheck=1第五行:数字签名检查,没有数字签名不允许安装,等于0时不进行数字签名检查。
gpgfile=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6第六行:指定Red Hat发行版数字签名公钥文件

[root@zh888 yum.repos.d]# mount /dev/cdrom /mnt//挂载iso文件到/mnt目录下
[root@zh888 yum.repos.d]# ls -l /dev/cdrom
lrwxrwxrwx 1 root root 3 Apr 12 18:16 /dev/cdrom -> sr //其实cdrom只是指向sr设备的软连接。
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@zh888 yum.repos.d]# ls /mnt
CentOS_BuildTag  Packages                    RPM-GPG-KEY-CentOS-Security-6
EULA             RELEASE-NOTES-en-US.html    RPM-GPG-KEY-CentOS-Testing-6
GPL              repodata                    TRANS.TBL
images           RPM-GPG-KEY-CentOS-6
isolinux         RPM-GPG-KEY-CentOS-Debug-6
 

[root@zh888 yum.repos.d]# 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)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sr0 on /mnt type iso9660 (ro)//这里说明已经挂载光盘iso

[root@zh888 yum.repos.d]# yum -y install vsftpd//安装vsftpd ftp软件
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
zh888                                                    | 3.7 kB     00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.i686 0:2.2.2-6.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
 Package          Arch           Version                  Repository       Size
================================================================================
Installing:
 vsftpd           i686           2.2.2-6.el6              zh888           155 k
Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)
Total download size: 155 k
Installed size: 343 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
ocsinventory-agent-2.0.4-1.el6.remi.noarch has missing requires of perl(Proc::Daemon)
  Installing     : vsftpd-2.2.2-6.el6.i686                                  1/1
Installed:
  vsftpd.i686 0:2.2.2-6.el6                                                    
Complete! //成功。