In this video, you'll learn some basics of software Management
on Olympics host.
Our plan is to explore how you can manage software in your Linux host
Amazon Linux uses the RPM file format to
package software and the Yum
package manager to manage them.
We were discuss package repositories and how yum uses
them to search and install RPMs.
You also execute some common yum commands like
search info update install and remove.
Okay, let's get started.
Okay. So here we are back in the terminal Linux use
this package of software called RPMs as it's smallest unit RPM
or red hat package manager is
it's an archive of software and metadata that makes up our
particular piece of your software.
These packages have a DOT RPM suffix,
the RPM tells the system where to
install the package in if in any dependencies it
needs.
So there's an RPM command that comes with your
Linux host if you're an RPM based distro, of
course.
And you could use this to actually install and manage some
RPMs on your host, but you should really opt to use
a package man instead keeping track of software and
it's dependencies to become complicated. And
this is what a package manager does best. So
our Linux host ships with the Yum package
manager so yum knows how to search install
remove and update RPM packages by default.
Yamo manage any software dependencies that are
needed to install and yum communicates with
what is a central repository of RPMs where
a packages are stored and then you'll see you'll hear
this referred to as like a repo or repository either one.
So one thing that we should probably note in the beginning here
installing or removing packages on a Linux host requires elevated
privileges. So you will be using sudo again
for this exercise.
All right. So there's a few subcommands that we will use with yum as
I talked about earlier yum can
do a lot of things but here's the ones that you'll probably use
the most and at least give you a good foundation going forward. They are
search info install removing update.
Since yum uses repositories to find out about
RPMs available, let's start out there and let's print out
what Repose we have access to so in your terminal go
ahead and type the Yum command with a
repo this subcommand.
So go ahead and hit return.
And here you can see that we have on the
left. It has the name of
the repo and over here. We have like a
more of a human readable canonical and the status
over here for each of those.
And so these are like package counts.
So you can see here. We have Amazon two core, which is one provided
by Amazon Linux. We have Amazon two extra for
Docker which is provided by Amazon Linux. We have an Amazon
two.
Extra kernel which provides kernel updates
extra that are not a part of the course system.
So the extra Repose or where you find other
repository other packages that are not a
part of your core system. This one's called apple as
well, but we are not going to use that
or talk about this in this course.
So you can also install RPMs via
the command line using the RPM command
you could do this manually or you
could actually download the source code from a project in
build it there as well to install it. But both of
those are beyond the scope of this course, but just
remember that you have those options if needed.
All right. So the first thing we're gonna do is we're gonna search for
a specific package in this case. I picked a package
called Cow Say and we'll get into a cow say is
in a second. So the first thing to do
Actually, let me let me clear the screen.
And we're gonna type the Yum search.
and the word cow say
so we're gonna go ahead and hit return. Once we
do we could see here that we have
a result and it says cow say
this no Arch means that this package will work on
any architecture whether it's x86 arm.
And it's configurable speaking thinking Kyle
and we'll get into a little bit more of that once again
thing.
So
we can also probe this package a little bit more to find
out a little bit more information about this this package.
It would also we can learn whether it's installed
or what available versions are. So let me clear the screen
and we're gonna use the Yum info subcommand
now.
And we'll tell it what package we want info on and then
we'll hit calci.
Go ahead and return and as you can see here, we have
available packages. So this package is not installed
or it would have told us what version was installed as well.
But as you can see here the name of it is cow say it's
version 3.04.
It the sizes 42 kilobytes and you have
a summary a URL the license it is and then
more importantly you have a description.
And so this is a good way. If you don't know what a package is and you want
to know exactly what the package does. This is a good way to you can find it out
and here it says obviously cow says I could figure
well talking how
Well, maybe not an extremely useful application. It's
still it's a good example of what
we can show to how to manage a package. Okay. So
with that out of the way, let's go ahead and install
Kyle say so here. You're going to need pseudo privileges
to install on the system. So we're going to do sudo yum.
install cow say
go ahead and return.
So this goes and checks the repositories it sees
if we have it locally or does it need to go out and fetch it from one of the repositories. It
tells us what it's gonna be doing down here. It resolves
a dependencies. It tells us though. It's
gonna install one package which is what we expect and then it's asking
us for confirmation. We'll hit okay, and then there we
go. It installed there was no errors. So
only thing left to do is to try it out and see if it worked
so Cal say the easiest way to use Cal say
is just to use the Cal State command and pass it a string message.
And so what we'll do is we'll just
say
Welcome.
this course
I know not very imaginative.
Okay. So there you have you have a talking cat
asky art cow with telling you to welcome
to this course.
Okay, so I know this is not like I said a
serious package.
So once you're done playing with it, and I
suggest you try other there's more flags that you can do. You can
change the eyes and in other things here and if you want to know more
those flags, you can use the man page. If you remember
what we did before you could type man cow say and you
can read all about Cow Say and what other options you
can use with it. It's time to remove Cow Say It's
Time to Say Goodbye to our cow. And so to do that
you can use the remove command and so once
again, you'll need sudo privileges.
And we say pseudo yum remove and the
package we want to remove.
And then hit return.
So here we again we get an output that says this is though. We're
gonna remove one package. This package is
the one that we were we're sure that we're gonna remove we don't want
to remove somebody accident and ask for confirmation. We just hit
y for yes.
And go now our cow is no longer.
All right, let me clear the screen.
Okay. So one of the last things that is important
to do as a system administrator on a host
is to update software. There's nothing more important than
keeping your software up to date for security reasons
alone. Not just for performance and Bug fixes. So
one easy way that you could do this with
yum is is a command that we can run called check
update. So in your terminal again
type yum check update.
And what this is going to do. It's gonna go out and see what's installed in our
system check the repositories and see what's available there
and calculate the dependencies of what Canon can
be installed.
So as you see here, there's a lot of output here
in if you counted this about 40 packages that
could be updated on my host.
Your system may not have these reboot may
not have these updates and that's depends on when you grab your Amazon Linux
host how many times you're rebooted if somehow
you've run this before?
So there's a lot of variables here and and it's okay if you
if it shows that there's no updates you can skip this step. I'm
going to show you because I think it's important to give
you good idea of what it's like to to update a system. So updating
system can take some time depending on the amount of packages
40 packages here is gonna take a few minutes being that
one of them up here. You can see is the kernel and the
kernel will require reboot if we want to start using the
new kernel. So what we'll do is I'll go ahead and run
the update and I'll come back when
it's done and I've done a reboot and once if you have to reboot
your seam remember when you SSH back in you're using the SSH kiwi
created in the earlier videos, okay, so
clear the screen and once again,
you need to a privileges.
And then I'm just gonna run yum update and here
it's gonna grab all these dependencies.
It's gonna install three new packages and that is
because this is dependencies of some of these updated versions
of them that I didn't have on the system prior.
And now it's gonna upgrade or update 39 in
the package that already on the system. So 42 actions
are basically gonna happen here and you can tell us it's
gonna be a 51 Megs and so once I hit
yes here it's gonna start doing this and so
I'll see you when I get back.
Okay, so we finished I haven't
rebooted yet, but I wanted you to see what it looked like at the
end of it. It installed a new kernel some new
python packages there and it also updated all these
packages. So at this point you can do
sudo reboot which will just reboot your host and
then I'll log back in so I'll pause it here and I'll come back
after we're actually logged back in.
Okay, so I'm back after the reboot. It takes a
little time you could take up to a minute. So just be patient if
if you're still waiting the system is up and back
and if you want we can go ahead and run the Yum check update
again and see if there's anything available and
as you can see, there's no output because there's no more.
Packages to update. Okay. So let's stop
there. I think it's a good stopping point. It's a good beginning of
your journey on package management.
Let's head back over and do a recap.
Okay, so let's talk about what we did in this video. You learn
how to manage software in your Linux host using the Yum package
manager.
You learned about package repositories and how
they store your RPMs.
Finally you executed the search info install
update and remove commands with
yum.
In the next video, you'll learn some basics of monitoring on
a Linux host.
See you soon.