Use the CD image as the software yum source in centos7
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 # used to use this directory name; cd/usr/local/srclsCentOS-7.0-1406-x86_64-DVD.iso # mount-tiso9660-oloop/usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso/media/cdrom/mount: /dev/loop0iswrite-protected, mountingread-only # cd/media/cdrom/[root @ mariadbcdrom] # lsCentOS_BuildTagEULAimagesLiveOSrepodataRPM-GPG-KEY-CentOS-Testing-7EFIGPLisolinuxPackagesRPM-GPG-KEY-CentOS-7TRANS.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/iso9660defaults, ro, loop00: x # Save and exit
Remarks: ISO CD-ROM disc standard file system
Mount-l/usr/local/src/CentOS-7.0-1406-x86_64-DVD.isoon/media/cdromtypeiso9660 (ro, relatime) [CentOS7x86_64]
[4] configure the local yum source file;
Vim/etc/yum. repos. d/centos7-media.repo [centos7-media] name = RedHatCentoslinux7.0 # custom baseurl = file: // media/cdrom # local image file path enabled = 1 #1 for starting yum source, 0 is disabled gpgcheck = 1 #1 is checked GPG-KEY, 0 is not checked gpgkey = file: // media/cdrom/RPM-GPG-KEY-CentOS-7 # GPG-KEY file pathYumcleanall # Clear cache Loadedplugins: fastest?cleaningrepos: basecentos7-mediaepelextrasupdatesCleaningupeverythingCleaninguplistoffastestmirrors[Root @ mariadb ~] # Cached # local yum source package information Loadedplugins: cached | 3.6kB00: 00: 00centos7-media | 3.6kB00: 00: 00 epel/x86_64/metalink | 5.3kB00: 00: 00epel | 4.4kB00: 00: 00extras | 3.3kB00: 00: 00updates | 3.4kB00: 00: 00 (1/20): centos7-media/group_gz | 157kB00: 00: 00 (2/20): centos7-media/filelists_db | 2.8MB00: 00: 00 (3/20): base/7/x86_64/group_gz | 157kB00: 00: 00 (4/20): centos7-media/primary_db | 2.7MB00: 00: 00 (5/20 ): centos7-media/other_db | 1.1MB00: 00: 00
[5] install software using local yum Source:
# Yum -- enablerepo = centos7-mediasearchhttpd # check whether there is an httpd package... httpd. x86_64: ApacheHTTPServerhttpd-devel.x86_64: DevelopmentinterfacesfortheApacheHTTPserverhttpd-itk.x86_64: MPMItkforApacheHTTPServerhttpd-manual.noarch: ToolsforusewiththeApacheHTTPServer... # yum -- enablerepo = centos7-media-yinstallhttpdInstalled: httpd. x86_640: 2.4.6-18. el7.centos# Rpm-qahttpdhttpd-2.4.6-18.el7.centos.x86_64
The local yum source has been configured!