How to create a RHEL7 repo along side my RHEL6 repo?

Latest response

Greetings!
I'm trying to find out how or what I would need to do in order to build a RHEL7 repo on our current Yum Repo Server.

Currently, we have a repo server serving up RHEL6. All of our vm's connect to it and upgrade via this repo.

I'd like to keep this RHEL6 repo and simply add a RHEL7 repo so I may do some test upgrades of snapshots to ensure things won't break during the upgrade process.

Any advice or help would be greatly appreciated.

Sincerely,
Trae

Responses

Hi Trae,

In the same manner you made a repository for your RHEL 6 Linux, repeat the process in a separate directory for RHEL 7. From your post, I don't know how you presented the repository. A repository can be presented by NFS/HTTP/FTP for example.

Your yum repo server as you call it, is it a web server? or NFS server? or FTP server? I don't know from your post, but there's a possibility you took an installation binary disk (usually over 4G dvd iso image) and made the contents available, used the "createrepo" command then made a corresponding text "rhel6.repo" file (the repo file is a very tiny text file that points to the repository that exists) and placed it in the directory /etc/yum.repos.d/rhel6.repo for instance. However, i don't know if you used a basic installation disk.

The sad part about using an installation disk is that sometimes after let's say someone makes a RHEL 6.8 disk to make a repository, and RHEL 6.9 becomes available, sometimes people don't bother to update it with RHEL 6.9 (the repository they created), and everyone is chained to RHEL 6.8 with the lack of security updates. And even when they go to 6.9 if someone updates the repo when 6.9 became available, the clock goes by on all the updates that they are not getting with a very static installation DVD repository. The same would fall true with RHEL 7.x, and version 7.4 is the latest.

So all of the above being said... Do you have a Red Hat Satellite server available? If you don't you are running off of the basic installation disk which was issued upon the date that major/minor release of Red Hat Linux was made available. So that presents security risks and then the next discussion is what security risks you might inherit by relying on an ever-aging ISO install disk for your yum repository. Having a Red Hat Satellite server will give you updates. This is a long discussion, and perhaps check out Red Hat Satellite server from Red Hat.

Have you ever made a Red Hat yum repository and presented it? From your post, I don't know what/how your environment is set up... So if you used a web-based RHEL 6.something disk, it would be on a web server and you would make a simple repo file to point to it after someone ran the createrepo command against that directory. If that is your case, then a RHEL 7 yum repository could be made in a similar way, and a separate repo file made available to the systems you wish to access it.

The documentation is here on how to configure yum and yum repositories.

Let us know if you need further assistance, someone ought to chime in here.

Regards,

RJ

If it's a web server...

  • Mount and copy or rsync the contents of the dvd to a web-facing directory, perhaps named "/var/www/html/pub/rhel74iso" important make sure you have sufficient disk space.
  • Run the createrepo -vv /var/www/html/pub/rhel74iso command as root
  • Make the permissions and security contexts are correct (SELinux), If you used rsync, then chances are the security contexts are fine, you might have to make the directory readable through your web server.
  • Create a repository file (repo file) such as this, it would end with a ".repo" extension and be placed in /etc/yum.repos.d/:
[rhel74iso_on_devweb1]
Name=rhel 7.4 iso yum repo on server devweb1-no-updates-basic-iso-disk
baseurl=http://devweb1.example.org/pub/rhel74iso
enabled=1
gpgcheck=1
  • Take that file and place it on the system you wish to access this. Do a sanity test and open a web browser to make sure you can really access the directory and download a file. *On any given server you are about to run yum commands, copy the file you made above to /etc/yum.repos.d/
  • run the command rpm --import /etc/pki/rpm-gpg/* just to avoid key signing issues, sometimes this is needed and it avoids odd errors at times.
  • Perform the command yum clean all and yum repo list.

Now some issues you may face, if there are other yum repository files that are active on any given system, and those yum repositories are broken (or interfere due to versioning etc), you may encounter issues with your yum commands. If that's the case, you'll have to examine any given system and disable/enable any repository files as needed. See the documentation in the last post I made, and the warnings in the last post too.

Good luck, Regards,

RJ

This article, How to create a local mirror ..., may have some helpful info.

I guess I should have mentioned we are using a mirror...

Create local mirror - I think it's same link above that Akemi gave me

I already have a working RHEL-6 mirror setup and working just fine for all of our servers. I'm trying to setup an RHEL-7 mirror on the same server that the current RHEL-6 mirror is set up on.

We use a script a former engineer wrote...

gist of script (Scroll down to bottom to see modified script)

I think all of my repo-id entries are bogus because I simply changed 6 to 7 in hopes that they would have kept the same formatting.

I think I'm close, but...

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.