[MUSIC]
Welcome to Red Hat Systems Administration I.
I'm Scott McBrien and today, I'll be talking to you about installing software using Yum.
Yum is an application that stacks on top of the Red Hat RPM package format.
RPM is how we put together the collections of software that we use for
installing stuff on Red Hat Enterprise Linux.
And Yum uses metadata and
a variety of other information to make package transactions easier.
So we store things like dependencies and information in the Yum repositories,
so that if we install a piece of software that requires
another piece of software already be there, it can take care of it and
install both pieces if they're not already on your system.
All right, so why don't we take a look at some of
the Yum commands and information that we can get up from Yum.
Alright, so one of the things that we can do with Yum is list packages that are available.
So we do a yum list and if we just run yum list by itself,
it's gonna produce a output of all of the installed packages on our
machine as well as all the available packages for our machine.
So yum list has two kind of useful arguments that you can add onto it.
So there is yum list install, which just shows you the stuff
that's installed on your machine and yum list available.
All the things that are available on the repositories that you're connected to
that is not currently on your machine.
All right. So you can look through the entire list or
it turns out that we might want to narrow our search a little bit,
cuz there's a lot of software that comes from Red Hat Enterprise Linux.
So we can also use Yum search to look for a keyword or phrase.
So for example, if we were interested in finding the Apache web server package.
I could do a, yum search apache and it's going to go through the repositories
that our machine is connected to and look for this keyword, apache.
It's gonna look for the keyword in the name of the package as well as the brief
description that is associated with the package and
it's gonna print out all the packages that match our search.
So, it's a much smaller list than all available packages.
Instead, contains some keywords that'll help us choose what package we might
be interested in.
All right. And
we can see that right here we have the httpd RPM.
Says, provides the Apache web server.
So, I'm going to use yum install
to install it on this machine.
So, it goes through and looks at all the dependencies that are required for
the software and it turns out that I have a couple that I need to install.
So, it's gonna add those to the package transaction to make sure that I have
everything that's required for the software I want to come onto the machine and
make it work properly.
All right. You'll notice that it provides me
a transaction summary.
So that's for me to review and go yes, this looks like the software that I want or
the transaction that I want and it has a prompt there asking me yes or no.
So, I'm gonna go ahead and say, yes.
And now, it starts downloading all of the RPM package files.
And once it's finished the download, it'll arrange them and install them on our machine.
So that's installing software.
If you want to remove software, the command is yum remove.
So, if I now wanted to remove the httpd RPM that
I got from my last transaction, yum remove httpd.
And again, it goes through and calculates any dependencies.
But this time, it's not looking for software that this package needs.
It's instead, looking at software that's on the system that might require this package
I'm trying to get rid of.
Because we don't want to remove a dependency for something else in the system.
All right. If that occurs, if there's a dependency for
this package from another package on the system
it'll add the dependent package to the transaction as well.
So, if there were something on top of Apache that needed Apache and I remove Apache,
it removes that thing on top as well.
And this is where something like the transaction history or
a transaction summary rather is really important to take a look at.
All right. What I'm doing in the removal,
I don't want to accidentally remove way more stuff than I intended,
because I didn't realize that this package was needed by so many other things.
All right. So,
in this example, Apache, the standalone package, so I can just say,
yes to the transaction summary and it will go ahead and remove that package.
But it's, again, it's my opportunity to look at the transaction summary and go, whoa,
400 packages.
No, no.
I, I don't want to remove that.
And if you were interested in, in seeing something like that
you can try to remove with something like RPM or Yum and
there would be a lot of packages that rely on those guys.
All right. If Red Hat has published updates for
your software.
Again, we use Yum.
So, instead of installing the software, because it's already on our machine,
we're gonna use update.
So, if Red Hat has published an update, we can do a yum update name of the package.
And it'll calculate the dependencies just like it does for an install, but the slight
difference in update is that as part of the transaction, it will delete the old version
of the software and then install this new version of the software to take its place.
All right. And yum update is how we manage updated
packages on Red Hat Enterprise Linux and related distributions.
All right. One of the new features of Yum is history.
So we can use yum history.
[SOUND] And
it shows us a list of all the transactions that we've done on the machine.
And one of the neat things that we can do with history is we can undo stuff,
we can undo transactions.
So the history uses the Yum log file, which is stored in var log yum.log.
If you wanted, you can take a look at it.
It's a text file.
And we can undo anything in the history to remove a transaction from our machine.
So, if I undid the removal, I just executed then it would install it back.
Or if I undid the install, it would remove it and
all the dependencies that it may have sucked in with that package.
All right. So Yum is a really handy tool.
It's got a lot of nice features beyond what we're talking here.
Things like you can look at information for
a package to get a little bit of data on what it does?
How big it is?
Where you got it from?
Yum stacks on top of the RPM package management infrastructure.
So things like GPG keysigning, so you can validate where the,
the package came from is integrated into Yum as well.
And that's a little bit on Yum package management and
managing software on your Red Hat Enterprise Linux system.
Thanks for being with me.
[MUSIC]