Repository proxy server aka satellite server for Redhat family.
This setup is done on Oracle Linux v9.5.
Preparations
vi /etc/hosts
add local ip to local host
dnf repolist
# disable repos in /etc/yum.repo.d
hostnamectl hostname lt58ncp1sat1
configure and attach disk for repositories (bear in mind that it will grow, consider LVM) prepare repo dir (to mounted disk)
mkdir /mnt/repo
mkdir -p /usr/share/nginx/html/repos
dnf update
dnf install \
createrepo \
yum-utils \
wget
Install webserver to serve packages
dnf install nginx
systemctl start nginx
systemctl enable nginx
systemctl status nginx
ss -ntap | grep nginx
cd /etc/nginx/
ls -la
vi conf.d/repos.conf
# webserver config here
```bash
nginx -t
SElinux
chcon -Rt httpd_sys_content_t /usr/share/nginx/html/repos
getenforce
Remove old repos
rm /etc/yum.repos.d/*
Add Oracle Linux official repositories
here
Add EPEL repos
dnf install epel-release
Add ClusterControl repo and keys
wget http://www.severalnines.com/downloads/cmon/s9s-repo.repo -P /etc/yum.repos.d/
rpm --import http://repo.severalnines.com/severalnines-repos.asc
rpm --import http://repo.severalnines.com/s9s-tools/CentOS_9/repodata/repomd.xml.key
Add MariaDB repo
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
Check repositories list
dnf repolist
Sync repos to the local storage (it will take time)
export dir="/usr/share/nginx/html/repos/"
dnf reposync -g --delete -p ${dir} --repoid=baseos --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=appstream --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=addons --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=crb --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=mariadb-main --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=mariadb-maxscale --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=mariadb-tools --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=s9s-repo --newest-only --download-metadata
dnf reposync -g --delete -p ${dir} --repoid=s9s-tools --newest-only --download-metadata
Create local repository
createrepo /usr/share/nginx/html/repos/
Client configuration
Remove old repos
rm /etc/yum.repos.d/*
Configure DNS for satellite server for local resolution
vi /etc/hosts
192.168.62.151 lt58ncp1sat1
Distribute repo file for clients.
vi /etc/yum.repos.d/lt58ncp1sat1.repo
[appstream]
name=Oracle $releasever - AppStream
baseurl=http://lt58ncp1sat1/appstream/
enabled=1
gpgcheck=0
[baseos]
name=Oracle $releasever - BaseOS
baseurl=http://lt58ncp1sat1/baseos/
enabled=1
gpgcheck=0
[crb]
name=Oracle $releasever - CRB
baseurl=http://lt58ncp1sat1/crb/
enabled=0
gpgcheck=0
[extras]
name=Oracle $releasever - Extras
baseurl=http://lt58ncp1sat1/extras/
enabled=1
gpgcheck=0
[epel]
name=Oracle $releasever - Epel
baseurl=http://lt58ncp1sat1/epel/
enabled=1
gpgcheck=0
[mariadb-main]
name=MariaDB Main
baseurl=http://lt58ncp1sat1/mariadb-main/
enabled=1
gpgcheck=0
[mariadb-maxscale]
name=MariaDB MaxScale
baseurl=http://lt58ncp1sat1/mariadb-maxscale/
enabled=1
gpgcheck=0
[mariadb-tools]
name=MariaDB Main
baseurl=http://lt58ncp1sat1/mariadb-tools/
enabled=1
gpgcheck=0
[s9s-repo]
name = Severalnines Release Repository
baseurl=http://lt58ncp1sat1/s9s-repo/
enabled=1
gpgcheck=0
[s9s-tools]
name = Severalnines Tools Repository
baseurl=http://lt58ncp1sat1/s9s-tools/
enabled=1
gpgcheck=0