[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! //成功。
本文出自 “有志者事竟成!” 博客,請務必保留此出處http://zh888.blog.51cto.com/1684752/832174