So this is an extremely important lesson.
In this lesson, you are going to learn how to set up a repository.
Why is this so important?
Well, because you might not have any repository access by default on the exam.
Remember, the exam is a disconnected environment, so you need to be able to connect it to something.
So here we go.
What is a repository?
A repository is a collection of RPM packages with an index that contains the repository
contents.
And repositories are often offered through websites.
But local repositories can be created also.
The dnf command is used as the default command to install packages from repositories.
And in RHEL 10, dnf is preferred over the yum command, which was used in previous versions
of RHEL.
But nevertheless, dnf and yum are offering the same functionality.
Normally, to access repositories, a RHEL system should be registered using Subscription Manager.
I'll tell you more about Subscription Manager in a later video in this lesson.
So Subscription Manager uses your entitlement to access the online Red Hat repositories.
But you need an active subscription.
And yes, you can do this with a developer subscription.
But do remember that on the exam, you are on a disconnected system.
And a disconnected system cannot connect to the Red Hat repositories.
Fortunately, as an alternative to online repositories, repositories can be offered through Red Hat
Satellite.
But if no internet connection nor Red Hat Satellite are available, no repositories will
be available by default.
And in that hypothetical case, you will have to manually configure a repository access.
This is an important task.
Now before setting up the repository access and showing you how this works, we need to
talk about GPG keys.
GPG is encryption.
It's an open source alternative for PGP, pretty good privacy.
This is GPG doing exactly the same.
And it is using GPG keys to sign content.
So a repository GPG key is used to sign all packages.
And before installing the packets, the signature is checked.
And in order to do this, you need a local GPG key to be present.
To make access and trusted repositories easier, on the exam, it's totally okay if you use
GPG check is zero.
And the repository client file.
On an online repository, if it is GPG signed on the first contact, you will automatically
fetch the GPG key.
But in the procedure that we are going to use to manually set up a repository server,
you probably don't have a GPG key.
And then GPG check is an important configuration option.
So how do we manually configure repository access?
Well, to access repositories that are offered through subscription manager, it's pretty
easy.
You use DNF config manager minus minus enable name of the repository to add repository access.
And third-party repositories can be added using a repo file in etc.yum.repos.d or using
DNF config manager.
And this is an important command that you need to fully understand for the exam.
So you would use a command like DNF config manager minus minus add repo equals file colon
slash slash slash repo slash fstream.
Which is doing what?
Well, this is pointing to a repository that's on the local file system.
That is what the URI file colon slash slash is doing.
And then a path slash repo slash fstream is indicating where exactly this repository can
be found.
You can also do it manually by creating a file in etc.yum.repos.d.
And in that file, you would have fstream as the label between the square brackets.
Name is fstream.
That's the name.
Base URL is file followed by the exact location.
Don't forget three slashes and not two.
And GPG check is zero to disable GPG repository checking.
Now there is one challenge.
The challenge is the following.
In the exam, most likely, they will give you information on how to access a repository
server.
And most likely, that will be a repository server that is installed locally in the exam
network.
And most likely, you are going to use an HTTP base URL to access this repository.
Unfortunately, in a standalone demo environment, such as you are using it right now, you can't
use it.
And you need to set up your own repository server.
And that is what this demo is about, configuring the installation disk as a repository.
Now you should realize that this procedure is not required on the exam.
But if you want to work and practice repositories in your own lab environment, you need to be
able to do it.
So let me show you.
OK.
So I'm going to set up a local repository server on my own machine.
To start with, I need df minus 8.
And I need to verify that I have at least 10 gigabytes available in the root directory.
And I do.
If you are looking at your configuration and you don't have 10 gigabytes available, then
you can go for the procedure that is on the bottom of the slide.
I'll tell you about it later.
But I prefer you go for this procedure.
So better reinstall your virtual machine and make sure that you do it on a 20-gig disk.
Then you will have 10 gigs available.
So first command is dd ifs slash dev slash sr0 ofs slash rel 10.iso bs is 1m.
What is this command doing?
This command is trying to clone your optical disk device.
So dev sr0 is the normal device file that corresponds to your optical disk device.
That is used as if, the input file, and the output file is rel 10.iso.
And if you get a message, no medium found, well, then probably you need to connect your
optical disk device.
So I'm going to do that in my VMware controls, where I see the optical disk right here.
And I'm going to connect cd dvd.
And that should be doing it.
In virtualization, the optical disk device isn't always connected by default.
Give it a little bit of time.
It shouldn't take too long.
And once you have given it some time, use the command again.
Depending on the speed of your disk, this can take between a few seconds and a few minutes.
Now I'm on a very fast NVMe disk.
And for that reason, in my configuration, the 8 gigabytes has been copied in less than
5 seconds.
Don't be surprised if you're on a slow disk if it takes 5 minutes.
Wait for it before you continue.
The result is that right now, I have a file with the name rel 10.iso.
And I'm going to use that ISO file and mount it in the slash repo repository.
And in case you are wondering, why don't you do that with the optical disk device?
Why don't you mount the optical disk device?
Well, then we would have a dependency.
And the optical disk device always needs to be present.
And that's not always the case.
And that is why this procedure is better.
Then we are going to tweak etcfs step.
And I will tell you about etcfs step in much more detail later.
But for now, I'm going to make a backup of the file in case anything goes wrong.
It makes it easy to repair access.
And then I'm going to add a line to etcfs step.
I'm using command redirection instead of an editor to do so.
So the line is rel 10.iso.
Andrew, remind me there's a typo on the slide.
Slash repo, this is where I want to mount it.
ISO 9660, that is the file system.
Defaults 00.
And that is what I need to add to etcfs step.
Can you please be very careful and make sure that you have a double redirect there?
Because if you don't have a double redirect but the single redirect,
then you are overwriting your current fs step.
And then you are in for some very interesting troubleshooting.
So now I added a line to etcfs step,
which is the file that is taking care of mounts automatically.
And I can use mount minus A,
which stands for mount everything that hasn't been mounted yet.
And as a result, in the slash repo directory,
we now have a lot of stuff.
And this lot of stuff, that is exactly what I need for the remainder of the procedure.
Because in slash repo, we have AppStream and we have BaseOS.
Let me show you what's going on in there.
I'm just picking one of them.
BaseOS is for core operating system files,
in which there is a subdirectory with the name packages,
in which you will find all the RPMs that belong to the core operating system.
AppStream is for additional applications.
You'll need both of them.
Good. Let's get back to the slide for a moment.
This other procedure is for if you don't have 10 gigabytes available in the root directory.
Then the only thing that you can do is mount the ISO file directly.
In order to do so, mkdir slash repo and echo dev sr0.
So dev sr0 is what you want to mount on the slash repo directory.
Make sure that is written to etcfs step.
Next, use mount minus a to mount it.
Again, I don't like this procedure because if ever your optical disk device is getting disconnected,
you can't install files anymore.
So better make sure that you have the 10 gigabytes option.
So where does this bring you?
This brings you to the part where you have a repository server that is available.
And now you can set up the repository access.
And setting up repository access is relatively simple.
So on this slide, you can see what to do.
Let me do it for you.
So I now have my repository server locally available,
but I haven't configured my repository client.
So dnf install mmap or whatever is not going to work and is giving this error message.
So in order to fix that, I'm using dnf config manager.
Minus minus add repo is file colon slash slash slash repo slash base OS.
And there you can see adding repo file.
Now, I need to edit this file.
And in order to do so, I'm using vim on etc yum.repos.d
on what is the name of the file repo base OS.repo.
I need to make sure that we have GPG check is zero.
Because without a GPG check is zero, you'll get a bunch of error messages telling you that,
hey, you have enabled GPG check, but I can't find the GPG key.
So I'm refusing to install any packages.
So this is number one.
Let's repeat this dnf config manager command again for the repo slash fstream repository as well.
As I mentioned, you need both of them.
So next, I'm going to edit etc yum.repos.d followed by repo underscore fstream.
And in this repo fstream on the bottom line, I'm adding GPG check is zero.
And that will do it for you.
And now the repository client is configured.
So we do a quick test, dnf install mmap.
It's getting repository information.
It's showing what it has found.
And it's showing you total size is 5.6M.
And after installing, it will be 24 megabytes.
And do we agree?
Yes, I agree.
And here we go.
And the package is installed.
So this concludes setting up a repository access.