[root@localhost mnt]# mkdir cdrom [root@localhost mnt]# mount /dev/sr0 /mnt/cdrom
Touch rehat7.6.repo [root@localhost yum.repos.d]# cat redhat7.6.repo [redhat7.6] name=my redhat7.6 baseurl=file:///mnt/cdrom enable=1 gpgcheck=0 [root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum clean all Loaded plugins: product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Cleaning repos: redhat7.6 Other repos take up 1.6 k of disk space (use --verbose for details) [root@localhost yum.repos.d]# [root@localhost yum.repos.d]# [root@localhost yum.repos.d]# yum makecache Loaded plugins: product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. redhat7.6 | 4.3 kB 00:00:00 (1/4): redhat7.6/group_gz | 146 kB 00:00:00 (2/4): redhat7.6/primary_db | 4.2 MB 00:00:00 (3/4): redhat7.6/filelists_db | 3.4 MB 00:00:00 (4/4): redhat7.6/other_db | 1.6 MB 00:00:00 Metadata Cache Created [root@localhost yum.repos.d]# [root@localhost yum.repos.d]# yum list |more Loaded plugins: product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Installed Packages GeoIP.x86_64 1.5.0-13.el7 @anaconda/7.6 NetworkManager.x86_64 1:1.12.0-6.el7 @anaconda/7.6 NetworkManager-config-server.noarch 1:1.12.0-6.el7 @anaconda/7.6 NetworkManager-libnm.x86_64 1:1.12.0-6.el7 @anaconda/7.6 NetworkManager-team.x86_64 1:1.12.0-6.el7 @anaconda/7.6 NetworkManager-tui.x86_64 1:1.12.0-6.el7 @anaconda/7.6 Red_Hat_Enterprise_Linux-Release_Notes-7-en-US.noarch 7-2.el7 @anaconda/7.6 acl.x86_64 2.2.51-14.el7 @anaconda/7.6 aic94xx-firmware.noarch 30-6.el7 @anaconda/7.6 alsa-firmware.noarch 1.0.28-2.el7 @anaconda/7.6 alsa-lib.x86_64 1.1.6-2.el7 @anaconda/7.6 alsa-tools-firmware.x86_64 1.1.0-1.el7 @anaconda/7.6 audit.x86_64 2.8.4-4.el7 @anaconda/7.6 audit-libs.x86_64 2.8.4-4.el7 @anaconda/7.6 authconfig.x86_64 6.2.8-30.el7 @anaconda/7.6 basesystem.noarch 10.0-7.el7 @anaconda/7.6 bash.x86_64 4.2.46-31.el7 @anaconda/7.6 bind-libs-lite.x86_64 32:9.9.4-72.el7 @anaconda/7.6 bind-license.noarch 32:9.9.4-72.el7 @anaconda/7.6 binutils.x86_64 2.27-34.base.el7 @anaconda/7.6
原文:https://www.cnblogs.com/lbjstill/p/13153818.html