1:CentOS的简单的很。顺手,将CentOS光盘加到自动挂载里面了。因为都是虚拟机的环境。加载镜像就可以了。
操作如下:
操作如下:
[root@rhce ~]# cat /etc/auto.master
#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc /etc/auto.misc
/net -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
[root@rhce ~]# cat /etc/auto.misc
#
# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
iso -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
[root@rhce ~]# cd /misc/iso
[root@rhce iso]# ls
CentOS RELEASE-NOTES-cz RELEASE-NOTES-es RELEASE-NOTES-ja RELEASE-NOTES-pt_BR.html RPM-GPG-KEY-CentOS-5
EULA RELEASE-NOTES-cz.html RELEASE-NOTES-es.html RELEASE-NOTES-ja.html RELEASE-NOTES-pt.html TRANS.TBL
GPL RELEASE-NOTES-de RELEASE-NOTES-fr RELEASE-NOTES-nl RELEASE-NOTES-ru
images RELEASE-NOTES-de.html RELEASE-NOTES-fr.html RELEASE-NOTES-nl.html RELEASE-NOTES-ru.html
isolinux RELEASE-NOTES-en RELEASE-NOTES-it RELEASE-NOTES-pt repodata
NOTES RELEASE-NOTES-en.html RELEASE-NOTES-it.html RELEASE-NOTES-pt_BR RPM-GPG-KEY-beta
[root@rhce iso]# tree -d /misc/iso/
/misc/iso/
|-- CentOS
|-- NOTES
|-- images
| |-- pxeboot
| `-- xen
|-- isolinux
`-- repodata
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
[root@rhce ~]# cd /misc/iso
[root@rhce iso]# ls
CentOS RELEASE-NOTES-cz RELEASE-NOTES-es RELEASE-NOTES-ja RELEASE-NOTES-pt_BR.html RPM-GPG-KEY-CentOS-5
EULA RELEASE-NOTES-cz.html RELEASE-NOTES-es.html RELEASE-NOTES-ja.html RELEASE-NOTES-pt.html TRANS.TBL
GPL RELEASE-NOTES-de RELEASE-NOTES-fr RELEASE-NOTES-nl RELEASE-NOTES-ru
images RELEASE-NOTES-de.html RELEASE-NOTES-fr.html RELEASE-NOTES-nl.html RELEASE-NOTES-ru.html
isolinux RELEASE-NOTES-en RELEASE-NOTES-it RELEASE-NOTES-pt repodata
NOTES RELEASE-NOTES-en.html RELEASE-NOTES-it.html RELEASE-NOTES-pt_BR RPM-GPG-KEY-beta
[root@rhce iso]# tree -d /misc/iso/
/misc/iso/
|-- CentOS
|-- NOTES
|-- images
| |-- pxeboot
| `-- xen
|-- isolinux
`-- repodata
7 directories
[root@rhce iso]# tree -C repodata/
repodata/
|-- TRANS.TBL
|-- comps.xml
|-- filelists.xml.gz
|-- other.xml.gz
|-- primary.xml.gz
`-- repomd.xml
[root@rhce iso]# tree -C repodata/
repodata/
|-- TRANS.TBL
|-- comps.xml
|-- filelists.xml.gz
|-- other.xml.gz
|-- primary.xml.gz
`-- repomd.xml
0 directories, 6 files
[root@rhce iso]# cat /etc/yum.repos.d/CentOS-Media.repo
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-5. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c4-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c4-media [command]
[root@rhce iso]# cat /etc/yum.repos.d/CentOS-Media.repo
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-5. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c4-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c4-media [command]
[c5-media]
name=CentOS-$releasever - Media
#baseurl=file:///media/CentOS/
# file:///media/cdrom/
# file:///media/cdrecorder/
baseurl=file:///misc/cd
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-beta
[root@rhce ~]# yum check-update
Loading "installonlyn" plugin
Setting up repositories
c5-media 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 798 kB 00:00
c5-media : ################################################## 2334/2334
Added 2334 new packages, deleted 0 old in 13.97 seconds
name=CentOS-$releasever - Media
#baseurl=file:///media/CentOS/
# file:///media/cdrom/
# file:///media/cdrecorder/
baseurl=file:///misc/cd
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-beta
[root@rhce ~]# yum check-update
Loading "installonlyn" plugin
Setting up repositories
c5-media 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 798 kB 00:00
c5-media : ################################################## 2334/2334
Added 2334 new packages, deleted 0 old in 13.97 seconds
0
