This is a standard offline repo setup for Red Hat Enterprise Linux
๐งฑ PART 1: Setup Repo Server (VM1)
๐ง Step 1: Install required tools
sudo dnf install -y dnf-plugins-core createrepo
๐ Step 2: Create repo directory
sudo mkdir -p /repo
cd /repo
๐ฆ Step 3: Download packages + dependencies
๐ Example (MongoDB):
sudo dnf download --resolve mongodb-enterprise-server mongodb-mongosh
๐ You can add more packages anytime:
sudo dnf download --resolve <package-name>
๐ Step 4: Verify RPMs
ls -lh /repo
๐ Must show .rpm files โ
๐๏ธ Step 5: Create repository metadata
sudo createrepo /repo
๐ Step 6: Start repo server
Quick method (for testing)
cd /repo
python3 -m http.server 8080
๐ Repo URL:
http://<VM1-IP>:8080
๐ฅ (Production recommended) Use Apache
sudo dnf install -y httpd
sudo systemctl enable httpd
sudo systemctl start httpd
Copy repo:
sudo cp -r /repo /var/www/html/
๐ URL becomes:
http://<VM1-IP>/repo
๐งฑ PART 2: Configure Client VMs (VM2 & VM3)
๐ง Step 7: Create repo config
sudo vi /etc/yum.repos.d/local.repo
Paste:
[local-repo]
name=Local Repo
baseurl=http://<VM1-IP>:8080
enabled=1
gpgcheck=0
๐ If using Apache:
baseurl=http://<VM1-IP>/repo
๐ Step 8: Refresh repo
sudo dnf clean all
sudo dnf makecache
๐ Step 9: Verify packages
dnf list available | grep mongo
๐ Packages should appear โ
๐งฑ PART 3: Install Packages from Repo
๐ฅ Step 10: Install
sudo dnf install -y mongodb-enterprise-server mongodb-mongosh
๐ PART 4: Adding New Packages Later
On VM1:
cd /repo
sudo dnf download --resolve <new-package>
sudo createrepo --update /repo
On VM2:
sudo dnf clean all
sudo dnf makecache
๐ง Best Practices
โ Always use:
dnf download --resolve
โ ensures dependencies included
โ Keep repo updated:
createrepo --update /repo
โ Use Apache for stability
- survives reboot
- production ready
๐ฏ Final Architecture
VM1 (Repo Server)
โ HTTP
VM2 -------- VM3
(install packages from VM1)
๐ You now have
- Offline package management โ
- Centralized repo server โ
- No need for subscription on other VMs โ
๐ If you want next level
I can help you:
- ๐ Sync full RHEL repo locally (mirror)
- โ๏ธ Automate with Ansible
- ๐ Secure repo with GPG keys
Just tell me ๐
