WEBVTT - This file was automatically generated by VIMEO

0
00:00:06.900 --> 00:00:09.600
In this video, you'll learn some basics of software Management

1
00:00:09.600 --> 00:00:10.500
 on Olympics host.

2
00:00:12.300 --> 00:00:15.200
Our plan is to explore how you can manage software in your Linux host

3
00:00:15.200 --> 00:00:19.000
 Amazon Linux uses the RPM file format to

4
00:00:18.700 --> 00:00:21.400
 package software and the Yum

5
00:00:21.400 --> 00:00:23.000
 package manager to manage them.

6
00:00:23.700 --> 00:00:26.200
We were discuss package repositories and how yum uses

7
00:00:26.200 --> 00:00:28.800
 them to search and install RPMs.

8
00:00:29.700 --> 00:00:32.300
You also execute some common yum commands like

9
00:00:32.300 --> 00:00:35.900
 search info update install and remove.

10
00:00:35.900 --> 00:00:37.300
 Okay, let's get started.

11
00:00:38.400 --> 00:00:41.300
Okay. So here we are back in the terminal Linux use

12
00:00:41.300 --> 00:00:45.300
 this package of software called RPMs as it's smallest unit RPM

13
00:00:44.300 --> 00:00:47.200
 or red hat package manager is

14
00:00:47.200 --> 00:00:50.600
 it's an archive of software and metadata that makes up our

15
00:00:50.600 --> 00:00:51.700
 particular piece of your software.

16
00:00:52.600 --> 00:00:55.600
These packages have a DOT RPM suffix,

17
00:00:55.600 --> 00:00:58.300
 the RPM tells the system where to

18
00:00:58.300 --> 00:01:01.600
 install the package in if in any dependencies it

19
00:01:01.600 --> 00:01:01.700
 needs.

20
00:01:02.800 --> 00:01:05.300
So there's an RPM command that comes with your

21
00:01:05.300 --> 00:01:08.200
 Linux host if you're an RPM based distro, of

22
00:01:08.200 --> 00:01:08.200
 course.

23
00:01:09.100 --> 00:01:12.200
And you could use this to actually install and manage some

24
00:01:12.200 --> 00:01:15.200
 RPMs on your host, but you should really opt to use

25
00:01:15.200 --> 00:01:18.700
 a package man instead keeping track of software and

26
00:01:18.700 --> 00:01:21.500
 it's dependencies to become complicated. And

27
00:01:21.500 --> 00:01:24.800
 this is what a package manager does best. So

28
00:01:24.800 --> 00:01:27.600
 our Linux host ships with the Yum package

29
00:01:27.600 --> 00:01:30.500
 manager so yum knows how to search install

30
00:01:30.500 --> 00:01:33.600
 remove and update RPM packages by default.

31
00:01:34.400 --> 00:01:37.300
Yamo manage any software dependencies that are

32
00:01:37.300 --> 00:01:40.200
 needed to install and yum communicates with

33
00:01:40.200 --> 00:01:43.200
 what is a central repository of RPMs where

34
00:01:43.200 --> 00:01:46.000
 a packages are stored and then you'll see you'll hear

35
00:01:46.300 --> 00:01:49.400
 this referred to as like a repo or repository either one.

36
00:01:50.200 --> 00:01:53.200
So one thing that we should probably note in the beginning here

37
00:01:53.200 --> 00:01:56.800
 installing or removing packages on a Linux host requires elevated

38
00:01:56.800 --> 00:01:59.300
 privileges. So you will be using sudo again

39
00:01:59.300 --> 00:02:00.000
 for this exercise.

40
00:02:01.200 --> 00:02:04.600
All right. So there's a few subcommands that we will use with yum as

41
00:02:04.600 --> 00:02:07.300
 I talked about earlier yum can

42
00:02:07.300 --> 00:02:10.300
 do a lot of things but here's the ones that you'll probably use

43
00:02:10.300 --> 00:02:13.600
 the most and at least give you a good foundation going forward. They are

44
00:02:13.600 --> 00:02:16.800
 search info install removing update.

45
00:02:17.700 --> 00:02:20.300
Since yum uses repositories to find out about

46
00:02:20.300 --> 00:02:23.200
 RPMs available, let's start out there and let's print out

47
00:02:23.200 --> 00:02:27.300
 what Repose we have access to so in your terminal go

48
00:02:26.300 --> 00:02:29.800
 ahead and type the Yum command with a

49
00:02:29.800 --> 00:02:31.500
 repo this subcommand.

50
00:02:32.200 --> 00:02:33.900
So go ahead and hit return.

51
00:02:34.800 --> 00:02:37.500
And here you can see that we have on the

52
00:02:37.500 --> 00:02:40.400
 left. It has the name of

53
00:02:40.400 --> 00:02:43.400
 the repo and over here. We have like a

54
00:02:43.400 --> 00:02:46.400
 more of a human readable canonical and the status

55
00:02:46.400 --> 00:02:48.500
 over here for each of those.

56
00:02:49.500 --> 00:02:51.400
And so these are like package counts.

57
00:02:52.100 --> 00:02:55.600
So you can see here. We have Amazon two core, which is one provided

58
00:02:55.600 --> 00:02:58.700
 by Amazon Linux. We have Amazon two extra for

59
00:02:58.700 --> 00:03:01.500
 Docker which is provided by Amazon Linux. We have an Amazon

60
00:03:01.500 --> 00:03:01.800
 two.

61
00:03:02.900 --> 00:03:06.400
Extra kernel which provides kernel updates

62
00:03:06.400 --> 00:03:08.900
 extra that are not a part of the course system.

63
00:03:09.800 --> 00:03:12.600
So the extra Repose or where you find other

64
00:03:12.600 --> 00:03:15.300
 repository other packages that are not a

65
00:03:15.300 --> 00:03:18.400
 part of your core system. This one's called apple as

66
00:03:18.400 --> 00:03:21.700
 well, but we are not going to use that

67
00:03:21.700 --> 00:03:23.300
 or talk about this in this course.

68
00:03:25.300 --> 00:03:29.200
So you can also install RPMs via

69
00:03:28.200 --> 00:03:31.500
 the command line using the RPM command

70
00:03:31.500 --> 00:03:34.300
 you could do this manually or you

71
00:03:34.300 --> 00:03:37.300
 could actually download the source code from a project in

72
00:03:37.300 --> 00:03:40.200
 build it there as well to install it. But both of

73
00:03:40.200 --> 00:03:43.100
 those are beyond the scope of this course, but just

74
00:03:43.100 --> 00:03:45.600
 remember that you have those options if needed.

75
00:03:46.300 --> 00:03:49.200
All right. So the first thing we're gonna do is we're gonna search for

76
00:03:49.200 --> 00:03:52.500
 a specific package in this case. I picked a package

77
00:03:52.500 --> 00:03:55.200
 called Cow Say and we'll get into a cow say is

78
00:03:55.200 --> 00:03:57.100
 in a second. So the first thing to do

79
00:03:58.400 --> 00:04:01.000
Actually, let me let me clear the screen.

80
00:04:02.100 --> 00:04:03.900
And we're gonna type the Yum search.

81
00:04:04.900 --> 00:04:06.200
and the word cow say

82
00:04:06.800 --> 00:04:09.600
so we're gonna go ahead and hit return. Once we

83
00:04:09.600 --> 00:04:12.300
 do we could see here that we have

84
00:04:12.300 --> 00:04:15.400
 a result and it says cow say

85
00:04:15.400 --> 00:04:18.400
 this no Arch means that this package will work on

86
00:04:18.400 --> 00:04:22.200
 any architecture whether it's x86 arm.

87
00:04:23.300 --> 00:04:26.300
And it's configurable speaking thinking Kyle

88
00:04:26.300 --> 00:04:29.300
 and we'll get into a little bit more of that once again

89
00:04:29.300 --> 00:04:29.800
 thing.

90
00:04:30.400 --> 00:04:30.500
So

91
00:04:32.100 --> 00:04:35.300
we can also probe this package a little bit more to find

92
00:04:35.300 --> 00:04:38.900
 out a little bit more information about this this package.

93
00:04:38.900 --> 00:04:41.400
 It would also we can learn whether it's installed

94
00:04:41.400 --> 00:04:44.300
 or what available versions are. So let me clear the screen

95
00:04:44.300 --> 00:04:47.500
 and we're gonna use the Yum info subcommand

96
00:04:47.500 --> 00:04:47.600
 now.

97
00:04:48.400 --> 00:04:51.200
And we'll tell it what package we want info on and then

98
00:04:51.200 --> 00:04:52.100
 we'll hit calci.

99
00:04:52.600 --> 00:04:55.600
Go ahead and return and as you can see here, we have

100
00:04:55.600 --> 00:04:58.300
 available packages. So this package is not installed

101
00:04:58.300 --> 00:05:01.100
 or it would have told us what version was installed as well.

102
00:05:01.100 --> 00:05:04.200
 But as you can see here the name of it is cow say it's

103
00:05:04.200 --> 00:05:05.500
 version 3.04.

104
00:05:07.100 --> 00:05:10.300
It the sizes 42 kilobytes and you have

105
00:05:10.300 --> 00:05:13.000
 a summary a URL the license it is and then

106
00:05:13.300 --> 00:05:14.900
 more importantly you have a description.

107
00:05:15.600 --> 00:05:18.100
And so this is a good way. If you don't know what a package is and you want

108
00:05:18.100 --> 00:05:21.200
 to know exactly what the package does. This is a good way to you can find it out

109
00:05:21.200 --> 00:05:24.100
 and here it says obviously cow says I could figure

110
00:05:24.100 --> 00:05:24.900
 well talking how

111
00:05:26.200 --> 00:05:29.700
Well, maybe not an extremely useful application. It's

112
00:05:29.700 --> 00:05:32.500
 still it's a good example of what

113
00:05:32.500 --> 00:05:35.600
 we can show to how to manage a package. Okay. So

114
00:05:35.600 --> 00:05:37.700
 with that out of the way, let's go ahead and install

115
00:05:39.200 --> 00:05:42.400
Kyle say so here. You're going to need pseudo privileges

116
00:05:42.400 --> 00:05:45.800
 to install on the system. So we're going to do sudo yum.

117
00:05:46.800 --> 00:05:48.700
install cow say

118
00:05:49.300 --> 00:05:50.100
go ahead and return.

119
00:05:51.500 --> 00:05:54.300
So this goes and checks the repositories it sees

120
00:05:54.300 --> 00:05:57.600
 if we have it locally or does it need to go out and fetch it from one of the repositories. It

121
00:05:57.600 --> 00:06:01.600
 tells us what it's gonna be doing down here. It resolves

122
00:06:00.600 --> 00:06:03.200
 a dependencies. It tells us though. It's

123
00:06:03.200 --> 00:06:06.400
 gonna install one package which is what we expect and then it's asking

124
00:06:06.400 --> 00:06:09.600
 us for confirmation. We'll hit okay, and then there we

125
00:06:09.600 --> 00:06:12.800
 go. It installed there was no errors. So

126
00:06:13.700 --> 00:06:16.200
only thing left to do is to try it out and see if it worked

127
00:06:16.200 --> 00:06:19.400
 so Cal say the easiest way to use Cal say

128
00:06:19.400 --> 00:06:22.400
 is just to use the Cal State command and pass it a string message.

129
00:06:22.400 --> 00:06:25.300
 And so what we'll do is we'll just

130
00:06:25.300 --> 00:06:25.400
 say

131
00:06:26.500 --> 00:06:27.200
Welcome.

132
00:06:28.300 --> 00:06:29.200
this course

133
00:06:30.400 --> 00:06:31.900
I know not very imaginative.

134
00:06:32.700 --> 00:06:35.400
Okay. So there you have you have a talking cat

135
00:06:35.400 --> 00:06:38.300
 asky art cow with telling you to welcome

136
00:06:38.300 --> 00:06:39.000
 to this course.

137
00:06:40.700 --> 00:06:43.400
Okay, so I know this is not like I said a

138
00:06:43.400 --> 00:06:44.000
 serious package.

139
00:06:44.800 --> 00:06:47.200
So once you're done playing with it, and I

140
00:06:47.200 --> 00:06:50.200
 suggest you try other there's more flags that you can do. You can

141
00:06:50.200 --> 00:06:53.900
 change the eyes and in other things here and if you want to know more

142
00:06:53.900 --> 00:06:56.100
 those flags, you can use the man page. If you remember

143
00:06:56.100 --> 00:06:59.300
 what we did before you could type man cow say and you

144
00:06:59.300 --> 00:07:02.200
 can read all about Cow Say and what other options you

145
00:07:02.200 --> 00:07:05.400
 can use with it. It's time to remove Cow Say It's

146
00:07:05.400 --> 00:07:08.200
 Time to Say Goodbye to our cow. And so to do that

147
00:07:08.200 --> 00:07:11.500
 you can use the remove command and so once

148
00:07:11.500 --> 00:07:13.200
 again, you'll need sudo privileges.

149
00:07:14.300 --> 00:07:17.400
And we say pseudo yum remove and the

150
00:07:17.400 --> 00:07:19.200
 package we want to remove.

151
00:07:20.200 --> 00:07:21.100
And then hit return.

152
00:07:22.100 --> 00:07:25.600
So here we again we get an output that says this is though. We're

153
00:07:25.600 --> 00:07:28.500
 gonna remove one package. This package is

154
00:07:28.500 --> 00:07:31.000
 the one that we were we're sure that we're gonna remove we don't want

155
00:07:31.100 --> 00:07:34.100
 to remove somebody accident and ask for confirmation. We just hit

156
00:07:34.100 --> 00:07:34.800
 y for yes.

157
00:07:35.800 --> 00:07:38.500
And go now our cow is no longer.

158
00:07:38.500 --> 00:07:40.000
 All right, let me clear the screen.

159
00:07:41.300 --> 00:07:44.800
Okay. So one of the last things that is important

160
00:07:44.800 --> 00:07:47.200
 to do as a system administrator on a host

161
00:07:47.200 --> 00:07:50.600
 is to update software. There's nothing more important than

162
00:07:50.600 --> 00:07:53.500
 keeping your software up to date for security reasons

163
00:07:53.500 --> 00:07:56.800
 alone. Not just for performance and Bug fixes. So

164
00:07:56.800 --> 00:07:59.200
 one easy way that you could do this with

165
00:07:59.200 --> 00:08:02.800
 yum is is a command that we can run called check

166
00:08:02.800 --> 00:08:05.100
 update. So in your terminal again

167
00:08:05.100 --> 00:08:07.700
 type yum check update.

168
00:08:08.400 --> 00:08:11.300
And what this is going to do. It's gonna go out and see what's installed in our

169
00:08:11.300 --> 00:08:14.600
 system check the repositories and see what's available there

170
00:08:14.600 --> 00:08:17.700
 and calculate the dependencies of what Canon can

171
00:08:17.700 --> 00:08:18.000
 be installed.

172
00:08:20.600 --> 00:08:23.200
So as you see here, there's a lot of output here

173
00:08:23.200 --> 00:08:26.300
 in if you counted this about 40 packages that

174
00:08:26.300 --> 00:08:27.900
 could be updated on my host.

175
00:08:28.900 --> 00:08:31.600
Your system may not have these reboot may

176
00:08:31.600 --> 00:08:35.000
 not have these updates and that's depends on when you grab your Amazon Linux

177
00:08:34.100 --> 00:08:37.800
 host how many times you're rebooted if somehow

178
00:08:37.800 --> 00:08:39.100
 you've run this before?

179
00:08:40.300 --> 00:08:43.200
So there's a lot of variables here and and it's okay if you

180
00:08:43.200 --> 00:08:47.100
 if it shows that there's no updates you can skip this step. I'm

181
00:08:46.100 --> 00:08:49.100
 going to show you because I think it's important to give

182
00:08:49.100 --> 00:08:53.300
 you good idea of what it's like to to update a system. So updating

183
00:08:52.300 --> 00:08:55.400
 system can take some time depending on the amount of packages

184
00:08:55.400 --> 00:08:58.800
 40 packages here is gonna take a few minutes being that

185
00:08:58.800 --> 00:09:01.800
 one of them up here. You can see is the kernel and the

186
00:09:01.800 --> 00:09:04.400
 kernel will require reboot if we want to start using the

187
00:09:04.400 --> 00:09:07.400
 new kernel. So what we'll do is I'll go ahead and run

188
00:09:07.400 --> 00:09:10.200
 the update and I'll come back when

189
00:09:10.200 --> 00:09:13.400
 it's done and I've done a reboot and once if you have to reboot

190
00:09:13.400 --> 00:09:17.100
 your seam remember when you SSH back in you're using the SSH kiwi

191
00:09:16.100 --> 00:09:19.500
 created in the earlier videos, okay, so

192
00:09:19.500 --> 00:09:22.400
 clear the screen and once again,

193
00:09:22.400 --> 00:09:23.800
 you need to a privileges.

194
00:09:25.300 --> 00:09:28.600
And then I'm just gonna run yum update and here

195
00:09:28.600 --> 00:09:30.500
 it's gonna grab all these dependencies.

196
00:09:31.400 --> 00:09:34.100
It's gonna install three new packages and that is

197
00:09:34.100 --> 00:09:38.000
 because this is dependencies of some of these updated versions

198
00:09:37.300 --> 00:09:40.100
 of them that I didn't have on the system prior.

199
00:09:40.900 --> 00:09:43.900
And now it's gonna upgrade or update 39 in

200
00:09:43.900 --> 00:09:46.700
 the package that already on the system. So 42 actions

201
00:09:46.700 --> 00:09:49.200
 are basically gonna happen here and you can tell us it's

202
00:09:49.200 --> 00:09:52.300
 gonna be a 51 Megs and so once I hit

203
00:09:52.300 --> 00:09:55.200
 yes here it's gonna start doing this and so

204
00:09:55.200 --> 00:09:56.300
 I'll see you when I get back.

205
00:09:57.700 --> 00:10:00.700
Okay, so we finished I haven't

206
00:10:00.700 --> 00:10:03.100
 rebooted yet, but I wanted you to see what it looked like at the

207
00:10:03.100 --> 00:10:06.400
 end of it. It installed a new kernel some new

208
00:10:06.400 --> 00:10:09.300
 python packages there and it also updated all these

209
00:10:09.300 --> 00:10:12.200
 packages. So at this point you can do

210
00:10:12.200 --> 00:10:15.200
 sudo reboot which will just reboot your host and

211
00:10:15.200 --> 00:10:18.100
 then I'll log back in so I'll pause it here and I'll come back

212
00:10:18.100 --> 00:10:19.500
 after we're actually logged back in.

213
00:10:21.200 --> 00:10:24.000
Okay, so I'm back after the reboot. It takes a

214
00:10:24.200 --> 00:10:27.500
 little time you could take up to a minute. So just be patient if

215
00:10:27.500 --> 00:10:30.300
 if you're still waiting the system is up and back

216
00:10:30.300 --> 00:10:33.500
 and if you want we can go ahead and run the Yum check update

217
00:10:33.500 --> 00:10:36.500
 again and see if there's anything available and

218
00:10:36.500 --> 00:10:38.700
 as you can see, there's no output because there's no more.

219
00:10:39.600 --> 00:10:42.600
Packages to update. Okay. So let's stop

220
00:10:42.600 --> 00:10:45.900
 there. I think it's a good stopping point. It's a good beginning of

221
00:10:45.900 --> 00:10:48.400
 your journey on package management.

222
00:10:48.400 --> 00:10:50.600
 Let's head back over and do a recap.

223
00:10:51.200 --> 00:10:54.700
Okay, so let's talk about what we did in this video. You learn

224
00:10:54.700 --> 00:10:57.700
 how to manage software in your Linux host using the Yum package

225
00:10:57.700 --> 00:10:58.000
 manager.

226
00:10:58.700 --> 00:11:01.300
You learned about package repositories and how

227
00:11:01.300 --> 00:11:02.900
 they store your RPMs.

228
00:11:03.600 --> 00:11:06.900
Finally you executed the search info install

229
00:11:06.900 --> 00:11:09.400
 update and remove commands with

230
00:11:09.400 --> 00:11:09.900
 yum.

231
00:11:11.600 --> 00:11:14.800
In the next video, you'll learn some basics of monitoring on

232
00:11:14.800 --> 00:11:15.600
 a Linux host.

233
00:11:16.300 --> 00:11:16.700
See you soon.
