RPM Command (Demo)

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, Cbrarians, and welcome back to
00:00
the Linux Plus course here at the Cybrary.
00:00
I'm your instructor Rob Gills,
00:00
and in today's lesson,
00:00
we're going to be discussing the RPM command.
00:00
Upon completion of this lesson,
00:00
you're going to be able to work with
00:00
RPM files by using the RPM command.
00:00
Now, recall in the previous lesson we discussed
00:00
the Red Hat Package Manager or RPM package types.
00:00
The Red Hat Package Manager was
00:00
the original package manager for working with RPM.
00:00
Package installs are now
00:00
normally done through something like yum,
00:00
dnf, or zypper,
00:00
and those are things we're going to cover
00:00
in upcoming lessons.
00:00
But the reason that we use those in place of
00:00
RPM is that these programs yum, dnf,
00:00
and zypper, allow us to install a package,
00:00
and any in all dependencies,
00:00
we'll touch upon that here in a minute.
00:00
But as I said, the RPM command is used to install
00:00
RPM packages with
00:00
the RPM package manager, hence the name.
00:00
Let's go ahead, and get started,
00:00
and get after it with some demo time.
00:00
Here we are in our site,
00:00
the West environment. You know what?
00:00
What I've done today is I've actually become
00:00
the root user just for expediency sake,
00:00
but also because I've placed a lot of
00:00
the packages we're going to work
00:00
with in the root directory.
00:00
Let's see each root, and then run an Ls,
00:00
and we can see in the root's home directory
00:00
we have an HTTPD package,
00:00
and we also have a pigeon package.
00:00
Now, HTTPD is used to install a web server,
00:00
and paging is an Instant Messenger client
00:00
that's used a lot in open source.
00:00
Let's go ahead, and try,
00:00
and install the RPM package
00:00
>> for HTTPD for the web server.
00:00
>> Now, if you're doing an install in RPM,
00:00
you just use the I-flag, I for install.
00:00
Then you can specify the package name.
00:00
We're going to HTTPD,
00:00
and then I just type tab to fill out
00:00
the entire package name, and then we can hit "Enter".
00:00
Now, we see that it failed. Well, why did it fail?
00:00
Look at error message here,
00:00
we said that we have failed dependencies.
00:00
The thing that you have to keep in mind
00:00
with the Red Hat Package Manager,
00:00
the RPM command is that when you're
00:00
installing RPM packages through RPM,
00:00
it does not install any dependencies.
00:00
What this is telling us is that in
00:00
order for the web server,
00:00
the HTTPD package, to install,
00:00
and run correctly, it means
00:00
all of these other packages as well.
00:00
We can certainly download all those packages,
00:00
and install them as
00:00
a whole by putting them all in the same directory.
00:00
But in general, nowadays it's just
00:00
easier to use yum or dnf or zypper,
00:00
the commands we mentioned in
00:00
the previous slide to do an install
00:00
with HTTPD because it
00:00
will download all the other dependencies,
00:00
and install them as a whole
00:00
while you install the web server.
00:00
Let's clear our screen, and let me show you an example
00:00
of a package that I know will install,
00:00
and that's going to be the pigeon package.
00:00
I'm going to do an RPM,
00:00
and now I'm going to put in I for install,
00:00
but I also want to get a verbose output.
00:00
I want to see what's going on.
00:00
Then I'm also going to
00:00
>> enter h so that I get a series of
00:00
>> hash marks that tell me about
00:00
the total progress of the installation.
00:00
A lot of times when you're doing
00:00
an install or doing something with RPM,
00:00
you tend to put all of
00:00
your options together into one line.
00:00
Remember RPM, IVH to
00:00
do an installs probably going to be more helpful.
00:00
Then we can specify the package we
00:00
want to install is this pigeon package.
00:00
Then we hit "Enter", and we see that it's giving us
00:00
a hash marks is going across the screen there.
00:00
We see that it's installed.
00:00
It did not need any dependencies,
00:00
so it's been installed. We're good to go.
00:00
Now, we can query, you see
00:00
the version of what we just installed.
00:00
We can just do an rpm- q pigeon,
00:00
and hit Enter,
00:00
and we can see that pigeon 21305ELAX8664 is installed.
00:00
If we want to see the files that got installed with it,
00:00
we can add an L to the queue,
00:00
q for query l for list,
00:00
and what it'll do is
00:00
it will list all of the files that have
00:00
got installed when pigeon got installed.
00:00
If we wanted to look, and see where
00:00
the documentation is for this,
00:00
we could give it another option.
00:00
You can combine q for query,
00:00
and d for documentation,
00:00
and then hit Enter,
00:00
and it'll tell us where all of
00:00
the documentation bits are stored for pigeon.
00:00
In fact, we can see the man page,
00:00
the manual down here for pigeon.
00:00
Finally, one thing we may want to
00:00
do is just do an RPM Qa.
00:00
That can tell us about all of
00:00
the packages that are installed on the system.
00:00
This will give us a long list of
00:00
all the different packages that are installed.
00:00
This is not super-helpful.
00:00
One thing you may want to do is actually just do
00:00
a grep for our pigeon for instance,
00:00
we know we just installed that. There we go.
00:00
It just tells us the version that we would've gotten
00:00
through just a Qa command by doing a grep for it.
00:00
Now finally, if we want to
00:00
>> uninstall something with RPM,
00:00
>> we just use E. Now YE for uninstall 1 i u.
00:00
Well u is used for something else.
00:00
It's used to update a package,
00:00
E is used to extract the package.
00:00
Remember when you're uninstalling something with RPM,
00:00
you actually use E for extract to uninstall.
00:00
We're just going to do it, RPM-E on
00:00
pigeon to extract or uninstall the package,
00:00
and just say Control L to clear my screen there.
00:00
Let's hit "Enter". Now,
00:00
we can see that it's removed.
00:00
That's pretty quick. How do we know that it's removed?
00:00
Well, let's try, and give a Q. Pigeon's not installed.
00:00
There we are. With that,
00:00
in this lesson, we covered how to work with
00:00
RPM files using the RPM command.
00:00
I hope to see you in the next lesson.
Up Next