OS: CentOS8本地源配置過程


CentOS8-stream 本地源配置

 

 

 


一、配置軟件倉庫(軟件倉庫位置:/media/CentOS)

 


1、建立目錄 “CentOS” 。(mkdir -p /media/CentOS)

 


2、掛載光盤“CentOS-Stream-8-x86_64-20210506-dvd1.iso”。

 


3、將光盤文件夾“AppStream”、“BaseOS” 復制到 “/media/CentOS”目錄。
    (cp    -r     AppStream/    BaseOS/           /media/CentOS

 

 

 

二、配置軟件倉庫文件(/etc/yum.repos.d/)

 


1、查看本地源配置文件:


[root@centos yum.repos.d]# cat CentOS-Stream-Media.repo
# CentOS-Stream-Media.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.

[media-baseos]
name=CentOS Stream $releasever - Media - BaseOS
baseurl=file:///media/CentOS/BaseOS
file:///media/cdrom/BaseOS
file:///media/cdrecorder/BaseOS
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[media-appstream]
name=CentOS Stream $releasever - Media - AppStream
baseurl=file:///media/CentOS/AppStream
file:///media/cdrom/AppStream
file:///media/cdrecorder/AppStream
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[root@centos yum.repos.d]#

 


2、開啟倉庫,將 “enabled=0”, 改為“enabled=1”

 

 

 

 

三、測試本地源倉庫:

 

 

[root@centos yum.repos.d]# dnf clean all
13 files removed
[root@centos yum.repos.d]# dnf makecache
CentOS Stream 8 - Media - BaseOS 68 MB/s | 2.5 MB 00:00
CentOS Stream 8 - Media - AppStream 72 MB/s | 7.1 MB 00:00
Last metadata expiration check: 0:00:01 ago on Sat 22 May 2021 03:31:48 PM CST.
dnf Metadata cache created.
[root@centos yum.repos.d]# dnf grouplist
Last metadata expiration check: 0:00:13 ago on Sat 22 May 2021 03:31:48 PM CST.
Available Environment Groups:
Server
Minimal Install
Workstation
Custom Operating System
Virtualization Host
Installed Environment Groups:
Server with GUI
Installed Groups:
Container Management
Headless Management
Available Groups:
Legacy UNIX Compatibility
Development Tools
.NET Core Development
Graphical Administration Tools
Network Servers
RPM Development Tools
Scientific Support
Security Tools
Smart Card Support
System Tools
[root@centos yum.repos.d]#

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM