redhat8.4 本地源配置(redhat-local.repo)
一、配置軟件倉庫(軟件倉庫位置:/media/redhat)
1、建立目錄 “redhat” 。
(建立目錄命令:mkdir -p /media/redhat)
2、掛載光盤“rhel-8.4-x86_64-dvd.iso”。
3、將光盤文件夾“AppStream”、“BaseOS” 復制到 “/media/redhat”目錄。
(復制文件夾命令:cp -r AppStream/ BaseOS/ /media/redhat )
二、配置軟件倉庫文件(/etc/yum.repos.d/)
1、查看本地源配置文件:
[root@redhatos ~]# cat /etc/yum.repos.d/redhat-local.repo
# redhat-local.repo
#
# You can use this repo to install items directly off the installation media.
# Verify your mount point matches one of the below file:// paths.
[local-baseos]
name=Redhat - local - BaseOS
baseurl=file:///media/redhat/BaseOS
file:///media/cdrom/BaseOS
file:///media/cdrecorder/BaseOS
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[local-appstream]
name=Redhat - local - AppStream
baseurl=file:///media/redhat/AppStream
file:///media/cdrom/AppStream
file:///media/cdrecorder/AppStream
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@redhatos ~]#
2、開啟倉庫,將 “enabled=0”, 改為“enabled=1”。
三、測試本地源倉庫:
[root@redhatos ~]# dnf clean all
13 files removed
[root@redhatos ~]# dnf makecache
Redhat - local - BaseOS 69 MB/s | 2.3 MB 00:00
Redhat - local - AppStream 82 MB/s | 6.8 MB 00:00
Last metadata expiration check: 0:00:02 ago on Wed 26 May 2021 05:15:39 PM CST.
Metadata cache created.
[root@redhatos ~]# dnf grouplist
Last metadata expiration check: 0:00:12 ago on Wed 26 May 2021 05:15:39 PM CST.
Available Environment Groups:
Server with GUI
Server
Minimal Install
Custom Operating System
Virtualization Host
Installed Environment Groups:
Workstation
Installed Groups:
Development Tools
Available Groups:
Legacy UNIX Compatibility
Container Management
.NET Core Development
Graphical Administration Tools
Headless Management
Network Servers
RPM Development Tools
Scientific Support
Security Tools
Smart Card Support
System Tools
[root@redhatos ~]#
[root@redhatos ~]# dnf groupinstall 'Development Tools'