Hello, everyone.
In this video, we are going to learn how we could install and update our software packages on a Linux
system.
A software is an application that you could run on your computer.
Just like in Windows Environment, you have a microsoft office market, Microsoft, PowerPoint, Firefox
browser or Internet Explorer browser calculator.
All of those are an example of a application.
Then run on your computer operating system.
A package when you download it is like a container that contains the software related programs, files
and executable.
The operating system is the one that actually unpackaged this and then go through the installation of
those executables.
So what we will learn in this video is the Linux package management using YAM and DNF command and RPM
command.
By the way, Yum command is the older command that has been deprecated, not fully deprecated in the
newer version of a well.
Now you could use either jump or DNF in my lectures I will be using Yum, but you could replace that
Yum with DNS if you like.
But eventually the DNF command will be the primary command that will be used for package management.
Then we have system update and patch management where we will learn about the minor or major upgrades.
And what is the difference between update updating a package or updating your complete system versus
upgrading it.
And the last thing that you will learn is about the advanced package management.
So let's go ahead and jump right away.
System updates and repos.
Repo stands for repositories.
This is a very important lesson for installing new packages to your systems.
So there are two major commands that are used in system updates and repos.
Installation is the first one is Yum Yum.
Command is mostly used in CentOS or in Red Hat environment, whereas APT Get is another similar command
that is used in other Linux distribution servers.
Yum Command installs a package from the repositories that are defined in your Linux system.
Those repositories, those configuration files has the URL link for repositories.
So when you run Yum, it's telling the system, go online with this URL and get the package that I'm
asking you to install.
So in other words, Yum does need an Internet access to go online and install a package to your system.
Then the next command we have is RPM.
RPM stands for Red Hat Package Manager.
Now RPM, of course, was first developed by Red Hat and is still in use by Red Hat.
But nowadays many other Linux distributions have carried over the same command rpm.
They never changed.
Now what's the purpose of RPM?
Before I tell you about RPM, let me tell you a difference between RPM and GM.
This way it will be much easier for you to understand what RPM is.
RPM is used when you already have a package downloaded in your system and then you could install it
locally by running the command rpm.
Now, whereas yum yum does all the things for you, it downloads the package.
It installs the package as well.
So RPM is mostly used in an environment where they don't have Internet access.
So let's get into our links machine.
I will try out both of these commands.
I am logged into my Linux machine as root, which directory I'm in, I'm in root directory and there
are different commands.
And of course what is my hostname?
My hostname is my first Linux machine, a linux os.
Of course, now we know we are not in the wrong system.
When you are installing packages, please also make sure run a hostname so you don't install packages
to a wrong system.
Okay.
So now the next step, the first command that we will learn is yum!
If I wanted to install a package, let's say, and twrp, all I have to do is type yum and TCP.
So yum install MTP.
It will go outside to the mirrors or whatever the URL has been specified and it will look for our MTP
package.
Now before it goes outside.
It looks for within itself, within it since its own system and see whether the NP package has been
installed already or not.
In this case I try to install MTP package.
And what happened?
It says MTP package has already been installed with the latest version.
So nothing to do.
Okay, perfect.
So I don't have to install it.
I don't have to update it.
Now, what about if I wanted to install Apache and Apache package name as http?
It will do again the same thing.
And if I have the system, if I have the package installed, it will give me the same message that it
gave me before.
It says no package http available I believe is http dd.
Okay.
Yes.
Same message.
HTTP feed sent to us, already installed and with the latest version.
So now before we go ahead and try a third package to install, I wanted to check if that package has
already been installed in my system or not and to check that I have to run the command R.P.M. minus
which is the option queue for Q3 query all the packages that I have installed my system with minus eight
with a option.
When you hit enter, it went into my list of packages that it installed.
It is giving me every single package.
Of course there are so many of them.
What if I wanted to know how many packages I have installed?
I will do simply wc minus l.
This will give me the total number of packages that are installed.
Of course WC minus L in this case is not actually counting the packages.
It's actually count counting the lines.
The output of RPM minus key.
This telling me there are 300,350 packages installed.
Now I want to see I want to install a package for Dennis.
Now, before I install a package for Dennis, I wanted to check if that package is installed.
So I'll do rpm minus Q grep and the package that needs to install association associated with Dennis,
it's called bind.
I'll do rpm minus Q and grep for bind only.
And you will see here it has bind libraries, key binds, bind libraries, bind license RPC, bind and
bind utilities.
So there is no package with just bind.
So it means I don't have DNS installed.
So what I will do is I will install by running the command yum install bind when I hit enter.
Now it's doing the same thing.
It's going outside on the Internet to all the repositories that are defined in my configuration files.
And it's coming back with the package saying, Hey, I found this package called Bind and it's architecture
version that I find which matches to your system a 64 bit.
The version that you will be installing of bind is this repositories are is to update the repository
and the size is 1.8 megabyte.
The transaction summary is right here install one package.
Total download size is going to be 1.8 meg.
So I'll go ahead and it will say, is it okay?
I'll say yes, go ahead to install the package.
And if you see the progress, depending on the speed of your computer, how fast it is connected to
the Internet, that's what matters in doing the download and install.
So right now, if you see the Yum is doing two things for us.
One, it's downloading the package.
Once his completed downloading, then right here, it's installing the package it installed.
Once it's installed, it verified it and it has confirmed that it has installed the package.
Now how do I verify again manually by running the command rpm minus q grep or bind.
And now this time you will see.
Right here.
Yes, the third or fourth line.
This one is just simply bind without any libs license or any other extra packages that needed for bind.
So yum also installs any dependencies.
Meaning if there is any of the packages that is required with this package, it does it for for salt.
Whereas RPM, if you have one RPM package, when you run the command, it will tell you, hey, I don't
have that dependency, so you have to install that package as well.
So to again to go back to our RPM command to install a package, you have to use a command RPM minus
I h we or you could change that to HIV via whichever the way you want space, the location of your RPM.
So if you have downloaded your RPM and let's say temp, then you will specify a slash temp slash package,
whatever the name of the package is.
And usually the package ends with RPM.
Then when you run this command, it will install that package for you.
Now you could also do RPM minus E to remove a package.
So let's say if I want to remove this package, bind the one we just installed.
So I will have to type here now.
Bind.
Our package is not in.
So sorry I did some kind of mistake.
So R.P.M. minus e.
Let me see if I could copy and paste.
Should be able to do that.
Yes.
Copy and paste
it.
It's gone.
Now can I verify it?
RPM minus q a grep for bind.
You see, it's not there.
So what do we do now?
If I wanted to install it back, I will do some install.
Fine.
Click.
Yes, to install it.
Yes, it is downloading again.
Same process and it's downloading now.
You probably be thinking, hey, didn't it download when we when we did the same command before.
Yes it did download.
But jump is very smart tool.
What it does, it downloads, it installs, it verifies and it also cleans up your download.
So the so your space disk space is used more efficiently so it doesn't keep the old downloads on your
system.
Okay.
So now the download is completed.
Let's check again if we have the package.
Yes, we do have the package.
And package is right here, the first one.
Now we use the RPM minus E command to remove that package.
Now, we could also do some remove bind and it will do the same thing as if I would do rpm minus E.
So it says remove one package.
Yes.
Go ahead and remove it.
System upgrade or patch management.
This is a very, very important topic.
Very, very important lesson for this.
For this training, you will be upgrading your system from time to time or applying patches to your
system on a quarterly basis, depending on your company's policies.
There are two types of upgrades that happen in Linux operating system.
One is the major version upgrade, which is from 5 to 6, 6 to 7.
And if you don't know what version of Linux we are running right now, then I would tell you right now,
stop everything again.
Stop everything and go back to your Linux VM and find out what version you are running.
And you will find that out.
How you could do Cat and see Red Hat Dash release or you name might say or there are different ways
that we have talked about previously.
So anyway, just to let you know if you don't know if you forgot, that is fine.
The version that we are running in our Linux machine is seven and the minor of that version is 7.4.
So there are two types of upgrades major versions five, six or seven and minor version from 7.3 to
7.4 or 7.1 to 7.2.
Or that stays within the same channel, which is like seven all the way from 1 to 5, six, seven or
wherever it ends.
The major version does not get you cannot get upgraded through the Yum command.
Minor version can be done through GM update command major version.
You cannot do how you could do the major version upgrade.
Well, you have to back up the entire server, build a new server from scratch and transfer files.
There are a few other ways that you could do it, but trust me, it's very cumbersome.
Example to do your update is simply running a command space update and option minus Y.
And the reason we have minus Y is because this is telling the operating system.
Every time you're going to prompt me to install a certain package, don't ask me, just install it.
So for every question, my answer is yes.
There is another way to do the update is update and upgrade.
Now what's the difference between update and upgrade?
Upgrade deletes packages?
When you have a package, let's say you have an anti package or issue type package and you you you did
gem upgrade.
It will delete the old package which is let's say http five and it has a new version, http six.
So it will delete that old package and it will update it with the newer package.
So that's a difference.
Whereas upgrade preserves it preserves the older packages as well.
Why?
Because it is a good practice for some system administrators to keep old packages in case they have
certain of their applications.
Don't comply or don't run with the newer version of the packages.
So that's why sometimes people have to roll back to its original patch updates.
So system upgrades and patch management, this is just a quick lesson for it.
I will go into my Linux machine again to try out a few of these commands.
I want to go in as putty.
So in order to go in as putty, what do you need?
I am keep typing this.
So this way you guys would know these this command or networking of a Linux machine.
So this is the IP you put in the IP address in the Linux machine.
I already have the the putty open.
Who am I.
I'm my I'm root.
So just minimize the console and now I have open putty.
So the first thing is right here.
Yum.
Update again when you do the jump update, it will preserve old packages, whereas upgrade would delete
old packages.
But before we go any further, what version do we have?
Have you checked that out?
So you do see.
At release, we have version major version seven and minor version four.
So we will do some update.
We will not put minus Y because I will show you when it will ask you if I wanted to proceed.
So just do jump update.
It is actually going through all the packages that require an update.
And it is telling you right here at this summary that scroll up that these are the packages that do
require some of them to be updated.
Every package has a dependency on other packages.
So if I'm installing package ABC, it might requires a package of X, Y, Z, just like in Windows.
If you are trying to install one package, it might require you to install Java as well or Flash or
some of those other packages.
Similarly, Linux works the same way when you are installing one package.
It does have other dependency, so it has to have those packages updated as well.
So that's why it's saying that it will install five packages, new ones and there are more updates that
are 209 packages of it.
So that includes five pack, that includes the dependency as well as the updates of the packages.
So we will say, is this okay?
Yes, it's okay.
Go ahead.
And yes, if I had put in space minus Y, it would not have asked me to put in my Y or I would not have
waited for me to put y.
So I'll hit y as yes.
So it's downloading packages.
It is going through the update process of 449 packages that it needs to update.
This will take quite some time.
So what I will do is I will fast forward this.
So at least you could view it how it is going through each package update.
Once the packages updates are done, then it will do the cleanup and and remove any lingering process
that's out there.
Okay.
The system has been updated and it is complete.
We did not get any error messages and by the way, I should have mentioned at the beginning, this makes
sure your system can go outside and every time you need to make sure you can just simply ping
google.com, it does go to Google, but just to make sure we have the right one.
So it is going outside and it is pinging every time you see it's coming back with 64 bytes from this
machine, it means it has internet access and it could talk to the server outside.
If it cannot, then you definitely have an issue and network issue.
And first, check those before you run the GM command, because the GM command is actually going to
the CentOS repository to download your packages or update your packages.
Okay, guys.
So in this lesson, we are going to cover advanced package management.
We have the package in our environment.
We installed it.
We learned those couple of commands earlier and one is Yum and the other one is RPM.
Now our RPM is a Red Hat Package Management Command.
There are other commands that are used in other Linux distribution like app get for a bun two and many
other different flavors.
But anyway, our focus is on CentOS and Red Hat, so we will be using RPM and Yum Command.
So what exactly we are going to do in advanced package management?
Well, in advanced package management we will learn how we could install packages.
Hey, we could do that through jump command, right?
Yeah, of course we could do that.
That's the best way to do the installation of the packages.
What if you already have the package and you just want install it?
So that part we will cover.
Then we'll learn how to do the upgrade of those packages, followed by how we could delete those packages.
Then we'll see how we could view a package detail.
Meaning if you have an install package and you want to know more information about the package, how
or when it was installed, what that is package is about when it was built, what are the configuration
file associated with it and a lot of other information related to the package.
Then also identify the source or location information if you have a file or if you're running a command,
let's say you run a command P.W or LZ, you want to know which package that command belongs to so that
type of information will cover.
So and last one is the package configuration file.
So if you have installed a package, let's call it ABC.
So we all know that all the package configuration files are by default in slash at C.
So once the package is installed and configuration files gets created at C, but then it goes into subdirectories.
So at C, slash this, slash that, that, we don't know.
So sometimes we even forget.
So how can we find out that information about a package if we are if we have done the download installation
and now it's about the configuration of that package.
So those are the things that will cover.
So to go with one of one by one, all those things, I'm going to go ahead and log into our Linux machine.
I'm going to use our putty session to search into the Linux machine.
So let's go into our lengths machine right here.
I have already logged in and I am logged in as.
Root.
And you could also verify by looking at this pound sign.
Okay.
So the package that we are going to install in this lesson or in this practice is corn shell package.
Now, corn shell is a shell which you probably have already know about.
It's just like a bash or seashell.
So I'm picking this just for practice purposes for just for this lesson.
So Corn Shell is the package that we do not have in the system and we are going to install needed to
be upgrade deleted view its package information and we'll cover everything that we have listed on on
this lesson.
So let's say if we have a corn shell package already installed in the system, so to check that you
will have to do rpm dash kua grep it for corn shell.
And you'll see we do not have that package installed in our system.
So now we have to install the package through two ways.
One is that we run yum, install the name of the package.
The second one is that we download the package through a different means.
If you do not have internet access, then you could download the package, then install it.
But I do have internet access on this machine and I can verify it by doing ping.
W w w let's say facebook dot com and you'll see I'll get a response back.
C It means that I am online, so you could also check by the running iff config command and you'll see
I have ip 1i21 6113 you probably have a different ip.
Depends on which network you are in anyway.
So I do have it in an axis and I don't need to download a package.
So what I could do is simply do some.
Install Case h consul.
Anything that is related to conceal.
I could just put it asterisk.
So hit enter.
And you will see it did find a package.
One package and the name of the package.
And it says X 64 package.
It doesn't have any dependencies.
Good.
So I'll go ahead and hit.
Why?
Also, if you notice, the bottom tells you the size of the package installed size, you could confirm
everything before you could go ahead and hit Y.
So hit enter.
And this is going to download the package first and then once the package is downloaded, then it will
go ahead and install that package, verify to clean it up.
So let's give it a few seconds and let it finish.
The package installation has been completed and it is successful.
Once you see at the bottom, it says complete.
Now how do we verify it?
Hit up our key again and you will see you have the package lost in rpm hq grep for coin shell hit enter.
And this is the package that was installed during our install command.
So now what?
If you wanted to remove that package, you could simply run the same command.
Yum.
Remove conch shell and hit asteroid enter.
This is going to go ahead and remove the package that it just installed.
Hit Y and it is complete and now run the package the RPM command again to query their database and the
little package that install.
And you'll see there is nothing, nothing installed that matches conch shell.
So that is the first and most preferred way to install and download and install a package.
Now coming back to the same scenario, what if you do not have Internet access or what if you do not
have a local repository?
Then what you have to do is you have to go.
You have to know the exact location where the file of how to download a file and then do RPM command
to install the package.
But first, let's go to our Internet and I'll go to Google.
If you have a different one different search method web server that you could use, you could use Bing
or whichever.
Anyway, so I'll type.
And as you can see, I already have typed in before download.
Conch shell.
For Santos seven.
So hit enter.
And go and click on the first link.
This will bring you to the package.
That org page come down and all the way down and you see where it says the package that ends with RPM.
Just simply right click to it and click on copy link address.
Once you did the copy link address, go back to your Linux machine and now this time type W get.
And the package exact location of the package and hit enter.
Now you're probably thinking, hey, I don't have Internet access and how can I download this package
if I don't?
Well, the simple way is you could go ahead and download on your machine, on the machine that already
has Internet connection, you download and then you get fttp or whichever way is preferred for you that
you can ftp over.
It has downloaded.
Where did it download?
Let's check p.w dx.
It's downloaded in slash root.
Let's verify it if it is there by doing it.
S minus tr hit enter and you'll see this is the package rpm.
Now we have installed this package before using the command.
Yum.
But now this time we are going to install this package using the command rpm, dash, hiv and the name
of the package.
The HIV are the different options.
You could use HIV HIV differently via HIV, whichever the way you prefer it.
I prefer it this way.
So go ahead and hit enter.
And now it has installed that package and now you could check by running RPM and its key way and graphical
shell and you will see the packages there.
Right.
So that is the way you could install that package.
Now what if you wanted to verify the information about the package, you could do RPM space.
Q I as an information and the name of the package.
Copy.
Right click, hit enter and you'll see the information about the package.
The package name is Corn Shell Version, release, architecture, install, date group and whole bunch
of information where you get it.
What exactly it does, what's the information about?
So this is about the information of that specific package that has been installed in your system.
Okay.
So next step is what how can you delete that package using our RPM command?
Remember, we learn how to delete a package you're using.
Yum, remove command.
Now let's delete a package using RPM for that you need to know exactly the location, the name of the
package.
So the name of the package you have it by getting running the command rpm disk.
Now run rpm dash e as for delete.
Specify the entire package name hit enter and now it has to leave the package verified by doing RPM
key way in full control.
And you see it has removed the package.
Okay.
So now this was about removing the package.
Now, I wanted to cover more things about this package, so I'll go ahead and install it again.
This time I'll install it with jump install strict.
This package and it has installed that package.
Perfect.
Again, verified.
Yes.
That package is there.
Now, I need to list configuration.
File of this package.
How can I list that?
So you could do our p rpm dash q c and the name of the package.
Hit Enter and you will see the configuration file that you need to modify in case you need to do the
some configuration of the package.
And these are the list of all the configuration file.
Remember I told you the package configuration file are always in ETSI directory, but then once you
are in C directly they are thousands of files, thousands of directories.
Where do we have to go exactly for that specific package?
Well, therefore that you have to find out the configuration file.
And how do you find out?
I just showed you rpm q c.
Now what if you want to find out some information of the A command.
Let's say if there is a command associated with this package and the command for that package is I know
offhand is corn shell just hit enter and that will bring you to a corn shell just like a regular command,
like ls command.
Every package has a command associated with it, so let's exit out.
So we go back to our bash shell.
So this is a command.
And what if you want to know which package this command belongs to?
For that, you have to run the command rpm.
Dash Qf.
And K.
S h.
Oops.
Sorry, I forgot.
First, I need to know the path of that package.
That command.
So I'll do which.
And it's telling me that cache command the full path is user bin usage.
Now I could do the command rpm queue and I'll put that here.
Hit enter.
And now it's telling me, hey, this command that you run, this command belongs to this package.
Good, good.
Now you're probably thinking, Hey, this is fun.
I could find out all the package information for all the commands that I have ran right so far.
Whatever the commands that you have learned, you could definitely find out which package it belongs
to.
For example.
My favorite command is, let's say every time you log in, I wanted to see who is logged in or which
directory I'm in.
So let's say PWT is the directory, right?
That's the that's the command which tells you which directory you are in.
So if you wanted to know which package this command belongs to first, what do you need to do?
You need to find out the command path.
So which P.W. RD.
Now you know that this command.
The full path for this command is usr bin pwt.
Now.
Do RPM.
Qf slash user slash bin and p and it is telling you that this command belongs to a package called core
utils.
And then version.
If you remove this package then you cannot run the command p d.
Then which actually you are in.
How are you going to find out?
You cannot find out.
So you would have to reinstall that package again using GM command or going to the link and downloading
it.
So that's how you actually find out the information about a specific package, specific configuration
of package or the package information of a command package.
Management is one of the things that everyone would face in their career at least twice a year or three
times a year when you have to do or install or upgrade the packages.
Hopefully this lesson serves a purpose.
If you have any question, always send me an email.
Hi.
So now this is the topic about creating a local repository from your DVD.
Now.
What is a repository?
A repository is something where all your packages are stored and then you could download and install
the package that you wish to.
Now you do need an internet access to go out of the outside repository and download and install the
RPM.
But what if you do not have internet access?
That's what exactly the local repository comes in.
So you have a Linux machine, right?
Whether it's a virtual or physical machine doesn't really matter.
It goes out to the Internet and then it goes out to a server, which is also most likely a Red Hat server
or CentOS server, which has a repository.
Now, some companies do have those repositories local to their environment, which which is called the
product that holds the repositories called satelite server.
So that is the repository which holds all your repos or RPM packages.
So you can bring them back in solid downloads.
Now, what happens if you do not have access to the outside world or if you do not have a red hat satellite
server in your environment, then how are you going to install new programs?
Well, in that case, you create a local repository, but then your server.
So this is what we're going to learn in this lesson on creating a local repository.
So the command to create or we will learn in this lesson it's create repo.
That's just one simple command.
So how does it work?
So let's get into our Linux machine.
My virtual machine is powered off.
Now I want you to go ahead and create a snapshot.
What snapshot does it's just takes a snapshot in case we need to revert back or if something goes wrong,
we could always go back to that snapshot.
So click right here, see the snapshot and click on take.
And by default gives the name snapshot one.
But you could give the the date or anything that you like that will make you remember.
I like to pick, date or sometime times if I'm creating multiple snapshots.
So now it has created a snapshot.
So in case I mess up during this creating log repository and I need to revert back to my original state,
which is right now, then I could always come back to it.
So now let's go ahead and power on.
So our machine has been started.
So let's go ahead and become root.
So now you are creating a local repository.
So what you're going to do is you're going to take all the RPM, all the packages from your DVD or CD,
CD ROM drive, which is a disk which has all your packages.
So what you do is you go into these menu devices, optical drives, choose disk and pick CentOS ISO
image.
So I have it saved on my desktop, so just choose it and click open.
So now this should automatically mount your DVD to your Linux machine.
See right away.
A pop menu came up and also if you notice, it will also create an icon on your desktop saying this
is the disk that has been attached, so now we have it attached.
How can we verify it on the command line?
You do DF minus h and you will see right here, the last row tells you that it is at R zero and it is
mounted on run media center seven.
So now if it is not mounted automatically, then you could run a command mount slash dev, cd rom and
wherever you want it to be mounted anyway, since it's already mounted for us.
Now the next step is where are you going to put all your packages?
So you have to create a directory, right?
So the directory I'm going to pick is let's go to slash, CD, Slash and under slash, make a directory,
let's call it local repo.
It's just the name.
You could pick anything.
You can pick Seinfeld, George Kramer or whatever you that you like.
So go ahead and hit enter do a list minus TR to verify it.
Is there.
Yes the directory is there.
Now I want you to copy all the contents to do the same.
To copy all the contents of the disk.
So do CD slash run slash media slash I.F. So now if you notice, the name of this image is sent to a
space seven space as s 886.
Now Linux does not like spaces, so how are we going to put that in my pad?
So if I just put in cent OS space seven x 86 underscore 64, so it says no such file a directory.
Then how how can I make Linux understand that there are spaces to do that?
The best thing that I would tell you to do is do CD run media of soul.
And when you are at this point on the forth directory subdirectory then hit tab and it would automatically
pick the ISO image under the self directory.
So if you notice it has backslash backslash which is telling Linux that there are spaces in it.
So go ahead and hit enter and now in you are in that directory.
Do ls myself here and see what's inside of it.
You see there are a few directories and files CD into packages.
That's where all the rpms are.
You could do it as myself.
Here you will see a bunch of rpms in there.
So if I wanted to see how many rpms do I have, I could do a at minus l tr type it w c minus l and it's
telling me there are 3973 packages or RPMs that are that are coming within that DVD image.
Well, that's a lot.
It is kind of like a repository.
So what are we going to do is we're going to copy all of these packages to our local drive, that local
folder that we just created, and the folder name is local repo, right?
So now before you do that, also make sure that you have enough space in your Linux machine.
So how do you find out first you are in that directory, write packages, run the command DU minus s,
h and dot, which are telling it which asking the Linux machine give me the disk space of the current
location of the directory that I'm in.
It is saying 3.7 gig now do DF minus h and make sure your slash.
The victory.
Has that space empty?
Yes, we do have four four available.
So it's good.
So now we could go ahead with copying every package that we have in this location.
The command I would use to copy is copy everything from this directory.
DOT Or you could specify the full path of run media.
I have all sent OS packages so you could do everything asteroid because you're copying everything under
packages to your local repo.
Hit enter.
Now it is going to copy every single rpm to the local repo directory.
This is going to take some time.
If you open up another window and then you go to CD to local repo and do ls minus l pipe it to wc minus
l, you will see the number of files being copied.
So right now we have 1480 files that have been copied.
We have to go up to 39 and something files to be copied.
Okay.
All the RPMs have been copied successfully.
Very good.
So we have to tell Linux.
Don't go outside.
We do have all the packages locally, so how do we define that?
So there are files in etsy yum dot repos dot dd.
These are all the files that tells the Linux to go to these different mirrors.
So what are we going to do is we're going to remove everything in here.
Now, again, before you remove that, please make sure you do have a snapshot.
If you delete all of these packages and you do not have the snapshot, then you won't be able to go
to internet and download the packages through Yum commands.
Everything is gone now.
Go ahead and create a new repo here.
Call it local repo
and add these values.
CentOS seven.
This is telling you these are a positive percent to seven name sent over seven base URL.
This is what matters.
So file.
Slash.
Local re.
Local repo.
This is the directory that we created in slash.
It was always starts with two slashes, then the third slash with local repo directly enabled and one
if you want to make it enabled.
GPG check zero.
These are some of the default values you have to put in to that file.
Go ahead and save it.
Once that is saved now we'll run the command create repo.
And where is my repo?
Local repo.
You hit enter now it's actually what it's doing is it's actually going to that local repo directory
and it's saying, hey, I have three 3000 90791 packages.
I'm going to make them available to my local machine as a repository.
The Create Repo has created the database that will be available to our GM command.
Now go ahead and create a yum clean run.
This command to jump clean.
All this is going to clear out any cash from the old repository.
Go ahead and run.
Yum.
Repo list.
All.
Now, this should tell me my full list of repositories.
There you go.
So we have a repo list that has a total package of 3971.
These are the exact same number of RPMs we had, remember?
And it telling you the size, the repo ID, the centos is the name that we picked and that our RPM directory
file.
Now you could test it by running the command yum install.
Now what do you want to install?
Just for test type tomcat.
It's going to go into their repository and check if it has a packages that matches tomcat.
Okay.
Perfect.
It did find that package.
And this is basically how you create a local repository.
Now, the system is not going out on the Internet or to your red hat satellite.
It is actually going to your local repository, which is sitting within your Linux machine.