1
00:00:06,639 --> 00:00:09,769
Now let's talk about the
Ubuntu package manager, which is apt.

2
00:00:10,750 --> 00:00:12,890
So APT is the
Ubuntu equivalent to Yum.

3
00:00:13,650 --> 00:00:20,445
It's the advanced package tool and it's a newer replacement of
all the utilities like APT Cache and apt. Get in the

4
00:00:20,445 --> 00:00:27,239
documentation every now and then you will find reference to
those, but APT in general should have replaced all of it.

5
00:00:27,739 --> 00:00:34,219
So you should be safe if you just use APT like
Yum. APT was developed to work with packages in an intuitive way.

6
00:00:35,039 --> 00:00:39,875
And APT is also using repositories
which are defined in etc. APT Sources

7
00:00:39,875 --> 00:00:44,710
list Before moving on, I need
to quickly show you these repositories.

8
00:00:45,990 --> 00:00:48,869
So I'm using
LS on etc.

9
00:00:51,850 --> 00:00:58,844
To show what is going on. And there you
can see there's a sources list, but there's also a

10
00:00:58,844 --> 00:01:05,840
sources list D. And it's important to realize that
because this sources list D contains drop in files.

11
00:01:06,500 --> 00:01:11,780
This is a generic trend that you find in
Linux a lot. You have a main configuration file

12
00:01:11,780 --> 00:01:17,060
like in this case the sources list. And
this main configuration file is provided by your distribution.

13
00:01:17,900 --> 00:01:24,299
Now you don't want to change the main configuration file because
during update it might get updated and your changes will get lost.

14
00:01:24,859 --> 00:01:30,290
And that's why the recommendation is to put
your own stuff in the drop in directory.

15
00:01:30,909 --> 00:01:35,185
And these drop in directories are normally
shaped as name of the original file

16
00:01:35,185 --> 00:01:39,460
followed by D. And there you put
the files that you want to use.

17
00:01:40,159 --> 00:01:46,959
Now it is important if you work with these
drop in directories that you respect the file format.

18
00:01:47,859 --> 00:01:53,103
Sometimes it is very specific for repositories
or red hat. For instance, they need to

19
00:01:53,103 --> 00:01:58,346
end in dot repo for for repositories
in Ubuntu. In this directory the name needs

20
00:01:58,346 --> 00:02:03,590
to end in sources, otherwise it won't
get recognized. Let's get back to the slides.

21
00:02:04,549 --> 00:02:06,469
So what do you need
to know to work with apt?

22
00:02:07,510 --> 00:02:11,349
Well, first you need to make
sure that the local list of packages

23
00:02:11,349 --> 00:02:15,189
is updated to the most recent
version of the packages using APT Update.

24
00:02:16,370 --> 00:02:21,210
There is the list of the packages in
the repository. There is the list of the packages

25
00:02:21,210 --> 00:02:26,050
on your system. And APT Update makes sure
that your system knows if newer versions are available.

26
00:02:26,780 --> 00:02:31,919
Next, you can use APT Search to search
for packages or APT Install to install packages.

27
00:02:33,039 --> 00:02:38,610
Now, on Ubuntu, if a package contains a
service, it will be started and enabled automatically. So

28
00:02:38,610 --> 00:02:44,180
normally after installing your services, you don't have
to do a sudo, systemctl, enable and so on.

29
00:02:46,080 --> 00:02:48,580
You can use APT
Upgrade to upgrade packages.

30
00:02:49,699 --> 00:02:54,649
And sometimes packages are installed as
dependencies but no longer required. If that's

31
00:02:54,649 --> 00:02:59,599
the case, use APT AutoRemove to
remove them. That will clean your system.

32
00:03:01,259 --> 00:03:05,360
You might also want to use
APT cache Search on a file

33
00:03:05,360 --> 00:03:09,460
name to search packages that contain
a specific file. Let me demonstrate.

34
00:03:11,060 --> 00:03:15,449
Let me start with
the sudo apt update that's

35
00:03:15,449 --> 00:03:19,839
going to fetch all
these package index files.

36
00:03:20,599 --> 00:03:24,300
140 packages
can be upgraded

37
00:03:24,300 --> 00:03:28,000
well, sudo
apt list upgradable.

38
00:03:28,819 --> 00:03:31,939
Let's follow the prompt
showing which packages that are.

39
00:03:32,500 --> 00:03:38,606
I'm not going to do that now
because I don't want to waste time.

40
00:03:38,606 --> 00:03:44,713
I'm going to search for packages. So
sudo apt cache search on iotop I

41
00:03:44,713 --> 00:03:50,819
o top is a utility that
allows me to monitor I O performance.

42
00:03:51,500 --> 00:03:55,105
And app cache search is
powerful because it allows you

43
00:03:55,105 --> 00:03:58,710
to search for files that
are contained within the package.

44
00:03:59,250 --> 00:04:05,379
Now, in this case, the result is a
little bit simple. The name of the package

45
00:04:05,379 --> 00:04:11,509
that contains iotop is also iotop. Okay, so
then I know that I need sudo apt

46
00:04:11,509 --> 00:04:17,639
install iotop to install it and that will
install it. And now my iotop is available.

47
00:04:19,560 --> 00:04:24,620
Is there anything else? Yeah,
maybe sudo apt auto remove.

48
00:04:24,620 --> 00:04:29,680
That's for these dependencies
that are no longer required.

49
00:04:30,259 --> 00:04:35,850
Now there are no dependencies that are no
longer required. So the result of this command is

50
00:04:35,850 --> 00:04:41,440
a little bit disappointing for the rest of
it. Apps like DNF was developed to be intuitive.

51
00:04:42,399 --> 00:04:47,954
I would say check on the help and try
what you can do with it. It's not that

52
00:04:47,954 --> 00:04:53,509
hard. In the next video, you'll learn about a
new way to work with software packages on Ubuntu.
