Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Create local Red hat repository

Leer en espanol
Create local Red hat repository

Table of contents

The first thing we have ===

In certain circumstances it may be advisable to have a local repository server for updating and installing packages on Red Hat or derived systems.

The first thing we have to do is install the necessary software:

Bash
yum install yum-utils createrepo httpd

Once installed we proceed to create the repository

text
reposync –gpgcheck -l –repoid=rhel-7-server-rpms –download_path=/var/www/html   –downloadcomps –download-metadata
createrepo -v /var/www/html/rhel-7-server-rpms -g comps.xml

We configure the repository in our client

config
cat /etrc/yum.repos.d/repositoryloca.repo
[local-repo-rhel7]

metadata_expire = 86400

baseurl = http://192.168.1.134/rhel-7-server-rpms/

name = Local Repository for RHEL 7

enabled = 1

gpgcheck = 0

We clear the cache

Bash
yum clean all

We can now install or update our operating system

Bash
yum –disablerepo=\* –enablerepo=local-repo-rhel7 update -y

All the best

:wq!

Comments