1. for details about how to mount CDROM, refer to: CentOS7 use the mount command to mount CDROM2 and check whether the createrepo command has been installed: rpm-qa | grepcreaterepo. if not, attach the ContOS CD, switch to the & ldquo;/mnt/cdrom/Packages & rdquo; directory and run the rpm command to install the package. 3. create cdrom
1. Mount CDROM
Refer to: CentOS7 use the mount command to mount CDROM
2. check whether createrepo has been installed.
Command: rpm-qa | grep createrepo
If the ContOS disk is not installed, switch to the "/mnt/cdrom/Packages" directory and run the rpm command to install it.
3. create a cdrom. repo file
Vi/etc/yum. repos. d/cdrom. repo
[Plain]View plaincopy
- [Cdrom]
- Name = CentOS7-cdrom
- Baseurl = file: // mnt/cdrom/
- Enable = 1
- Gpgcheck = 0
- Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
4. test and view the cdrom Package List
Yum -- disablerepo = * -- enablerepo = cdrom list
5. local installation
Yum -- disablerepo = * -- enablerepo = cdrom grouplist
Yum -- disablerepo = * -- enablerepo = cdrom groupinstall "X Window System"