RPM Package Managers

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hello cybrarians, and welcome back to
00:00
the Linux Plus course here at Cybrary.
00:00
I'm your instructor, Brad Galison
00:00
and in today's lesson,
00:00
we're going to be discussing RPM package managers.
00:00
Upon completion of today's lesson,
00:00
you're going to be able to work with yum and
00:00
DNF package managers and CentOS,
00:00
and also you're going to understand how to use
00:00
the Zypper package manager in SUSE.
00:00
A little bit of
00:00
information about these three package managers.
00:00
The first one that we're going to talk about is
00:00
yum or Yellowdog Updater Modified.
00:00
Now, this is something that was acquired by
00:00
Red Hat from another distribution called Yellowdog,
00:00
hence the name, and it's
00:00
an enterprise package manager for
00:00
working with RPM packages.
00:00
It's the current package manager for
00:00
all of the Red Hat Enterprise Linux systems,
00:00
but on the community-based Red Hat editions
00:00
or Red Hat-based community editions rather,
00:00
Dandified YUM or DNF is becoming a replacement,
00:00
and is becoming more rapidly used in that environment.
00:00
DNF is just a drop-in replacement for yum,
00:00
which means that you can just use a command
00:00
more or less exactly the same as yum,
00:00
and we'll see that as we go forward.
00:00
But this is something that you can use
00:00
in CentOS or Fedora.
00:00
Then finally the last one is SUSE,
00:00
which uses a package manager actually called Zypper.
00:00
Because SUSE just does things just
00:00
a little bit differently,
00:00
but we'll get to play around with
00:00
a Zypper command as well.
00:00
Let's do that with some demo time.
00:00
Here we are in our CentOS environment
00:00
and we're going to start with yum.
00:00
Now remember, all of these commands can be
00:00
used to install a package and its dependencies.
00:00
In our previous lesson,
00:00
we weren't able to actually install httpd using
00:00
the RPM command and the RPM package manager,
00:00
because it doesn't install the dependencies.
00:00
But let's try that again with yum,
00:00
we can do yum install httpd.
00:00
What it's going to do is it's
00:00
going to go ahead and look at
00:00
the install package or the package we're trying
00:00
to install httpd,
00:00
and it's going to pull down all
00:00
the other packages that we need,
00:00
all of these dependencies.
00:00
If we want to install, we just hit
00:00
"y" and it will pull down and install
00:00
all those packages along with
00:00
the HTTPD package that we already have on our system.
00:00
There we are, it's installed.
00:00
Now, if we were like,
00:00
wait, what did we just install?
00:00
We can do a, yum info httpd,
00:00
and that will show us the information
00:00
about what we just installed, the package.
00:00
It's going to tell us the name,
00:00
the barge and the release
00:00
and give us a description of it.
00:00
Obviously here, it's
00:00
the Apache HTTP server
00:00
and it's a web server we're installing in our system.
00:00
Now if we want to see all of
00:00
the packages that we installed in the system,
00:00
we can do a yum list
00:00
installed and you can see that this flies by.
00:00
Not super helpful.
00:00
It's usually better if you pipe it
00:00
to a grep command and
00:00
then you can search for something installed.
00:00
If we want to see what was installed along with
00:00
HTTPD or what has the name HTTPD on the search string,
00:00
we can do yum list installed and then grep HTTPD,
00:00
and we'll see all of the HTTPD associated
00:00
packages or packages with that name that got installed.
00:00
Now, if we wanted to go ahead and remove that,
00:00
we could do a yum remove httpd.
00:00
This will simply remove the HTTPD package,
00:00
but also all of these other dependencies,
00:00
because these are no longer used.
00:00
Once HTTPD is removed,
00:00
we don't need these either,
00:00
so we can hit "y", and those
00:00
will all get removed and cleaned up.
00:00
Let's see if we can find our pidgin command.
00:00
We downloaded the RPM or I downloaded
00:00
the RPM for use in the previous lesson.
00:00
But if we want to install it,
00:00
could we install it instead of using RPM by using yum?
00:00
Let's do a search. Let's do yum search for a pidgin.
00:00
Sorry that's not the right spelling,
00:00
let's change that to P-I-D-G-I-N, and there we are.
00:00
We see that, yes, yum knows
00:00
what pidgin is and it can install it.
00:00
We can install this if you wanted to
00:00
with yum install pidgin.
00:00
But you might be asking, well, how does
00:00
yum know what these are?
00:00
Well, yum uses a concept
00:00
called a repository or software repository,
00:00
and we can see all the repositories that yum
00:00
knows about by using yum repo list.
00:00
These are all the places that yum will
00:00
go to look for software packages,
00:00
so when we do a search,
00:00
it will search through all of these different repos
00:00
to find out if it knows about that software.
00:00
If it doesn't, you may actually have
00:00
to go out to a vendor and get
00:00
a package or a repo file that you can use to update,
00:00
or you might need to install it from
00:00
source and that's something that we'll
00:00
talk about down the road.
00:00
Let's finally do some other stuff.
00:00
Well, if we're doing a lot of work in yum,
00:00
sometimes we want to clean up after ourselves,
00:00
we can use a command called yum clean all to do that,
00:00
and that removes any temporary files
00:00
that we are no longer using.
00:00
If we want to check and see if you have updates,
00:00
we can run a command called yum check update.
00:00
This will check and see if there are any updates for
00:00
this specific Linux system that I'm working on,
00:00
making sure that the operating system is up-to-date
00:00
based on the current packages that
00:00
are up here in the repositories.
00:00
That's what it's doing. It's just querying
00:00
the repositories now to see if
00:00
there are any packages that are missing on
00:00
the system that need to be installed.
00:00
If we just wait a moment, holly molly,
00:00
this is the measurement patch at
00:00
awhile, so we've got a lot of them.
00:00
But that is generally all that we need to
00:00
know about using yum.
00:00
If we wanted to do an update,
00:00
we could do a yum update.
00:00
I'm not going to make you all sit here for
00:00
that because it will take a very long time.
00:00
Well let's move forward and work with
00:00
our next command, which is DNF.
00:00
Let's clear our screen and clear this out.
00:00
As I said, DNF works just like yum.
00:00
It's a drop-in replacement.
00:00
Behind the scenes DNF does things a little bit
00:00
differently in terms of the way that it manages RPMs,
00:00
but for you and I working with it,
00:00
it works pretty much exactly the same as yum.
00:00
If we wanted to do an install,
00:00
we can do a DNF install on,
00:00
let's say MariaDB, which is a database software.
00:00
Instead of doing a yum install,
00:00
we do DNF install and then it
00:00
gives us the ability to install it,
00:00
by just hitting "y" along with the dependencies.
00:00
Now if we wanted to get the information
00:00
about this after it's finished installing,
00:00
just like we saw with yum,
00:00
we could do a DNF info on MariaDB.
00:00
There's all the information on the package.
00:00
We have the name,
00:00
the version, the release,
00:00
and also the description of
00:00
this package and it's a database,
00:00
and it's community developed MySQL.
00:00
Now if we wanted to
00:00
see all the packages that are installed.
00:00
What do you think we do? Well,
00:00
we just do DNF list install.
00:00
Just like we were doing yum list install.
00:00
We just provide DNF in place of yum
00:00
and we can grep that for the package we just installed.
00:00
You do grep for Maria and this will show us
00:00
anything with the string Maria and the name,
00:00
and we can see MariaDB and some of
00:00
the packages that I installed
00:00
along with it when we installed it.
00:00
Let's clear the screen
00:00
there so we can see a little bit more.
00:00
If we wanted to install pidgin,
00:00
can we see if that's available?
00:00
We're going to do a DNF search pidgin.
00:00
Well, this looks exactly the same and it's
00:00
because it's querying the same repost.
00:00
In fact, we can just do a dnf repo list,
00:00
just like we did yum repo list
00:00
and we see all the repos are the same.
00:00
The system is using the same repos,
00:00
and if you're using yum command or the DNF
00:00
command's going to use the same repositories.
00:00
Just like we saw with yum, we can do a DNF clean all.
00:00
That remove files that were no longer necessary.
00:00
Then if we wanted to check for updates,
00:00
we can do a DNF check update.
00:00
This will provide us with any
00:00
updated files for the system.
00:00
Hopefully this will be a little bit quicker
00:00
since we just ran this in yum,
00:00
we'll wait for it to finish
00:00
here and it will give us a list of
00:00
any and all packages that
00:00
need to be updated on the system.
00:00
Again, the system has not been updated a little bit,
00:00
mostly for desired not to break any of our demos.
00:00
But we're going to stop here.
00:00
Let's move over to SUSE
00:00
and let's play with the Zypper command.
00:00
Here we are in SUSE. This is
00:00
actually openSUSE distribution that I installed.
00:00
Here we are in SUSE, and this is actually
00:00
an open SUSE distribution
00:00
that I've installed as virtual machine.
00:00
You might already be going, what is this?
00:00
This looks very different.
00:00
Well before when we were in CentOS,
00:00
we were using something called
00:00
GNOME as the desktop manager,
00:00
but here in SUSE they're using something called
00:00
KDE or KDE Plasma as the desktop manager.
00:00
You'll see things like K-Console
00:00
with a case that a Console with a C,
00:00
that's just a naming convention that they use in KDE.
00:00
Obviously it's a little bit of a different layout.
00:00
But terminal commands pretty much
00:00
>> work exactly the same,
00:00
>> we're going to play with Zypper
00:00
which is just a little bit different.
00:00
First let's become root by doing sudo bash over here,
00:00
[NOISE],
00:00
and it'll become the root user clear our screen there.
00:00
Then if we wanted to install HTTP,
00:00
or actually let's install Apache 2 on the system
00:00
because SUSE uses Apache 2 in place in HTTPD.
00:00
We could do a zypper in for install,
00:00
apache 2 and then hit "Enter".
00:00
It will seem that it's updating,
00:00
grabbing the repositories, and
00:00
it needs to install some packages.
00:00
We can hit "y" [NOISE] and it'll
00:00
install the package apache 2,
00:00
and any other dependencies that we need,
00:00
just like we saw with yum in DNF.
00:00
Now if we want to get information
00:00
about what we've just installed,
00:00
we could do a zypper if on Apache 2,
00:00
and that will give us the information
00:00
>> that we're looking
00:00
>> for about the package that we just installed.
00:00
There we go. It tells us about the name,
00:00
the version, the arch, and the description down here.
00:00
Now if we wanted to see if there are
00:00
any packages that we need to install,
00:00
let me clear my screen first,
00:00
but we can run a command called zypper list patches.
00:00
This will just look for updates or required packages.
00:00
We see that there's nothing that we need
00:00
because I've actually already
00:00
installed all these packages.
00:00
If we did have updates,
00:00
we can install those with a zypper patch command.
00:00
This will install any packages that are not needed,
00:00
and if we wanted to do a system update
00:00
or update we can do that as well with zypper update,
00:00
pretty much the same as zypper patch.
00:00
This will check for updates and pull them
00:00
down and install if the need be.
00:00
But finally, just like what we saw when we did a
00:00
remove in DNF and yum,
00:00
we can do a remove in Zypper.
00:00
If we wanted to remove
00:00
the Apache 2 we've just installed,
00:00
we can do zypper remove or even better,
00:00
we can just do zypper rm apache 2,
00:00
and this one will uninstall or
00:00
remove the Apache 2 package,
00:00
the web server package on the system.
00:00
With that we've reached the end of the lesson.
00:00
In this lesson we covered how to use the yum
00:00
and DNF package manager and CentOS,
00:00
and also how to use the Zypper package manager in SUSE.
00:00
Thank you so much for being here and I look
00:00
forward to seeing you in our next lesson.
Up Next