how create rhel8 local repository server

Repository Server Configuration

Mount DVD.iso. Create DVD repo.

[BaseOS]
name=DVD_BaseOS
enabled=1
gpgcheck=0
baseurl=file:///mnt/BaseOS
[AppStream]
name=DVD_AppStream
enabled=1
gpgcheck=0
baseurl=file:///mnt/AppStream
yum install -y createrepo yum-utils bash-completion vim bzip2 java

Disable repo ID of DVD.repo.

yum-config-manager --disable BaseOS
yum-config-manager --disable AppStream

Set Proxy Configuration.

cp /etc/profile ~/
vim /etc/profile

Set RHSM configuration

cp /etc/rhsm/rhsm.conf ~/
vim /etc/rhsm/rhsm.conf
proxy_hostname = 10.10.212.1
proxy_port = 8080

Registering a system for HREL Account.

subscription-manager register
xxxxx
xxxxx
subscription-manager attach --auto
subscription-manager refresh

Update yum Data

yum clean all
yum makecache

View repo list

yum repolist all | grep enabled

Create folder

mkdir -p /home/repo/rhel8

vim patch_download.sh

--#!/bin/bash
reposync -p /home/repo/rhel8/ --download-metadata --repoid=rhel-8-for-x86_64-baseos-rpms
reposync -p /home/repo/rhel8/ --download-metadata --repoid=rhel-8-for-x86_64-appstream-rpms
createrepo --update /home/repo/rhel8/rhel-8-for-x86_64-appstream-rpms/
createrepo --update /home/repo/rhel8/rhel-8-for-x86_64-baseos-rpms/

posted @ 2025-09-29 15:56  k98091518  阅读(10)  评论(0)    收藏  举报