Use the CD image as the software yum source: [1] Upload The centos7 CD image to the/usr/local/src Directory (tool Xftp) [2] mount the system file mkdir/media/cdrom & nb
Use a CD image as the software yum source:
[1] Upload The centos7 CD image to the/usr/local/src Directory (tool Xftp)
[2] mounting system files
| |
Mkdir/media/cdrom # This directory name is used to it; cd/usr/local/srclsCentOS-7.0-1406-x86_64-DVD.iso # mount-t iso9660-o loop/usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso/media/cdrom/mount:/dev/loop0 is write-protected, mounting read-only # cd/media/cdrom/[root @ mariadb cdrom] # lsCentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-7EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS. TBL |
[3] setting automatic mounting of system image files upon startup
| |
Vim/etc/fstab/usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso/media/cdrom/iso9660 ULTS ults, ro, loop 0 0: x # save and exit |
Remarks: ISO CD-ROM disc standard file system
| |
Mount-l/usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso on/media/cdrom type iso9660 (ro, relatime) [CentOS 7 x86_64] |
[4] configure the local yum source file;
| |
Vim/etc/yum. repos. d/centos7-media.repo [centos7-media] name = Red Hat Centos linux 7.0 # custom baseurl = file: /// media/cdrom # Local image file path enabled = 1 #1 for starting yum source, 0 for disabling gpgcheck = 1 #1 for checking GPG-KEY, 0 does not check gpgkey = file: // media/cdrom/RPM-GPG-KEY-CentOS-7 # GPG-KEY file path |
| |
Yum clean all # clear cache Loaded plugins: fastestmirrorCleaning repos: base centos7-media epel extras updatesCleaning up everythingCleaning up list of fastest mirrors |
| |
[Root @ mariadb ~] # Yum makecache # cache local yum source package information Loaded plugins: fastestmirrorbase | 3.6 kB 00:00:00 centos7-media | 3.6 kB 00:00:00 epel/x86_64/metalink | 5.3 kB 00:00:00 epel | 4.4 kB 00:00:00 extras | 3.3 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/20 ): centos7-media/group_gz | 157 kB 00:00:00 (2/20): centos7-media/filelists_db | 2.8 MB 00:00:00 (3/20): base/7/x86_64/group_gz | 157 kB 00:00:00 (4/20 ): centos7-media/primary_db | 2.7 MB 00:00:00 (5/20): centos7-media/other_db | 1.1 MB 00:00:00 |
[5] install software using local yum source:
| |
# Yum -- enablerepo = centos7-media search httpd # check whether there is an httpd package... httpd. x86_64: Apache HTTP Serverhttpd-devel.x86_64: Development interfaces for the Apache HTTP serverhttpd-itk.x86_64: MPM Itk for Apache HTTP Serverhttpd-manual.noarch: Documentation for the Apache HTTP serverhttpd-tools.x86_64: Tools for use with the Apache HTTP Server... # yum -- enablerepo = centos7-media-y install httpdInstalled: httpd. x86_64 0: 2. 4.6-18. el7.centos |
| |
# Rpm-qa httpdhttpd-2.4.6-18.el7.centos.x86_64 |
The local yum source has been configured!