VM Config
VM Specifications:
- CPU: 1vCPU (2 cores)
- RAM: 2 GB
- HD: 100 GB
Change the hostname:
Update the IP:
Install
Install the pre-reqs:
Enable the services to start automagically:
Start the services:
Add firewall rules:
Create the repo paths:
The following command will reach out and download copies of the official repositories. "newest-only" will help to keep the repository size mangeable.
Only download the latest package version: --newest-only
Download non-default metadata: --download-metadata
Specifies the location to save the packages: -p
Specify repository ID: --repo
Create the Repo
createrepo is not required for Rocky 8. reposync will download everything including the repodata. sudo createrepo /var/www/html
Setup CROBTAB
In this section, we will create a cron job to update the repos.
OPTIONAL:
If there is a cron.allow file, then the user or users that need to use cron will need to be listed in the file. You can use cron.deny to explicitly disallow certain users from using cron. If neither files exist, then only the super user is allowed to run cron.
Add the user names, one user name per line.
Change the email address where cron output is sent.
Cronie should have already been installed earlier. To list cron jobs, type:
To list cron jobs for a user, type:
To add new jobs, use the command below. This will use the default editor. By using sudo, this will add the jobs to the root accounts cronjob. As a result, using sudo in the actual commands is not necessary.
The following commands will schedule a cron job to update the directory daily at 3am and in 30min incruments every Monday. The format is as follows: minute hour day month day_of_week username command
NOTE:
See the "createrepo" note above schedule a cron job to update the repo database after the regularly scheduled cron job finishes.
00 5 * * mon createrepo --update /var/www/html
Client Setup
For the love of all that is holy, make a backup.
The following lines will comment out the "mirrorlist." This way the defaults can be easily restored.
The following lines are appended to the bottom of the respective *.repo configs. These can be commented to easily restore the defaults.
Verify repo setup
References
- https://phoenixnap.com/kb/create-local-yum-repository-centos
- https://access.redhat.com/solutions/23016
- https://www.redhat.com/sysadmin/how-mirror-repository
- https://adam.younglogic.com/2020/08/syncing-and-serving-yum-repos-on-rhel-8/
- https://oracle-base.com/articles/linux/create-a-local-yum-repository-for-oracle-linux-8
- https://www.server-world.info/en/note?os=CentOS_8&p=localrepo
- https://computingforgeeks.com/how-to-create-centos-8-local-repository-mirrors-with-rsync-nginx
- https://kc.jetpatch.com/hc/en-us/articles/360053185271-Setting-Up-Local-Repositories-CentOS8
- http://dl.rockylinux.org/pub/rocky