1 00:00:00,090 --> 00:00:01,470 Hello, the beautiful people. 2 00:00:01,470 --> 00:00:07,110 Now, probably one of the most confusing things for new users of a GNU Linux operating system is understanding 3 00:00:07,110 --> 00:00:11,580 how to get new software now on other operating systems like Windows or Mac. 4 00:00:11,580 --> 00:00:15,420 Every time that you want to install a piece of software, you're probably just used to downloading an 5 00:00:15,420 --> 00:00:17,760 executable file, opening it, hitting next. 6 00:00:17,760 --> 00:00:18,360 Next, next, next. 7 00:00:18,360 --> 00:00:18,660 Next. 8 00:00:18,660 --> 00:00:23,640 A load of times avoid avoiding reading terms and conditions, but agreeing anyway and celebrating internally 9 00:00:23,640 --> 00:00:25,260 when your new software is installed. 10 00:00:25,500 --> 00:00:27,390 Now in Linux, it works a bit of a different way. 11 00:00:27,390 --> 00:00:31,500 I mean, you still celebrate internally when the software is installed, but you tend to install it 12 00:00:31,500 --> 00:00:36,630 in a way that is much more integrated, standardized, secure and scalable that is possible with the 13 00:00:36,630 --> 00:00:38,010 other operating systems. 14 00:00:38,010 --> 00:00:42,510 But to get those benefits from using a package manager, we first need to let go of our preconceptions 15 00:00:42,510 --> 00:00:47,340 from Windows and Mac and actually get a solid understanding of what is going on in Linux package management 16 00:00:47,340 --> 00:00:50,280 because it's not the same at all, but it is a lot better. 17 00:00:50,280 --> 00:00:55,590 So in this video you're going to learn about how to search for packages using APT by building off our 18 00:00:55,590 --> 00:00:57,630 existing knowledge of the software repositories. 19 00:00:57,630 --> 00:01:01,890 And we're going to show you how you can search those software repositories using the APT package manager. 20 00:01:01,890 --> 00:01:06,510 And you're also going to learn about how the app package manager uses caching to speed up performance 21 00:01:06,510 --> 00:01:09,540 and ensure that you have a fast installation experience. 22 00:01:09,540 --> 00:01:14,370 So by the end of this video, you're going to be able to know how to search the software repositories 23 00:01:14,370 --> 00:01:18,360 for new packages, and that's going to give you the fundamental understanding that you'll need in order 24 00:01:18,360 --> 00:01:19,110 to install them. 25 00:01:19,110 --> 00:01:21,180 So let's go ahead and get right into it. 26 00:01:22,240 --> 00:01:22,630 Okay. 27 00:01:22,630 --> 00:01:26,860 So as of now, we understand that there are a bunch of packages that exist and there will be using a 28 00:01:26,860 --> 00:01:30,250 package manager called APT to download and install them. 29 00:01:30,310 --> 00:01:31,810 So far so good. 30 00:01:31,840 --> 00:01:35,530 So let's start off by getting the APT program to search for packages. 31 00:01:35,530 --> 00:01:40,090 And let's say that we wanted to search for packages that will help us when working with Microsoft Word 32 00:01:40,090 --> 00:01:40,780 files. 33 00:01:40,840 --> 00:01:46,150 Now Microsoft Word files have conventionally had the extension dot, dock x, so let's find all the 34 00:01:46,150 --> 00:01:48,550 packages that are relevant to the text dock x. 35 00:01:48,940 --> 00:01:59,350 So to do that we would type the command apt dash cache OC Search Dock X and when we do that we see that 36 00:01:59,350 --> 00:02:06,280 we get a few results back with one package per line and we see that for each package we get the name 37 00:02:06,280 --> 00:02:07,690 of the package on the left. 38 00:02:08,050 --> 00:02:11,170 So you can see we've got one here called Dock X to two text. 39 00:02:11,200 --> 00:02:13,390 We've got one here called Lib, Apache and so on. 40 00:02:13,390 --> 00:02:17,410 And then on the right we get a short description about that package. 41 00:02:17,410 --> 00:02:24,940 So this will turn Microsoft s XML files to plain text, and this one is a general markup converter and 42 00:02:24,940 --> 00:02:27,010 it's the libraries for that general markup converter. 43 00:02:27,010 --> 00:02:30,940 So you can see at a glance what, what is available. 44 00:02:30,940 --> 00:02:35,020 And for example, if we wanted to search for things to do with text, we could always use grep and search 45 00:02:35,020 --> 00:02:38,050 for the word text and we would get just a few results there. 46 00:02:38,050 --> 00:02:40,780 So you can also narrow this down using grep. 47 00:02:40,810 --> 00:02:41,150 Okay. 48 00:02:41,200 --> 00:02:47,650 So it appears here that we may be interested in this one here called dock x to txt. 49 00:02:47,890 --> 00:02:48,400 Okay. 50 00:02:48,400 --> 00:02:51,190 So how would we get a bit more information about that? 51 00:02:51,210 --> 00:02:59,530 What we could do if we clear the screen is do is use apt cash show dock x to text. 52 00:02:59,560 --> 00:03:07,000 So instead of apt cast search and then a keyword, we're going to use apt cash show and then the package 53 00:03:07,000 --> 00:03:07,360 name. 54 00:03:07,360 --> 00:03:11,890 And when we enter that, you can see that we get a whole bunch of information about that package. 55 00:03:11,890 --> 00:03:16,360 Now this is exactly the kind of information that's good to pipe through the less command to make it 56 00:03:16,360 --> 00:03:17,560 a bit easier to deal with. 57 00:03:17,560 --> 00:03:21,130 There we go so we can see the package name is Dock X to txt. 58 00:03:21,160 --> 00:03:23,410 It's available for all architectures. 59 00:03:23,710 --> 00:03:26,920 It gives you the version number and it also tells you where it's from. 60 00:03:26,920 --> 00:03:31,390 So it's from the universe repository, the text section in there. 61 00:03:31,390 --> 00:03:37,330 It tells you the maintainers with their contact information tells you where to report any bugs and it 62 00:03:37,330 --> 00:03:38,500 tells you loads of other stuff. 63 00:03:38,500 --> 00:03:44,800 But down here there's also a description and it says it converts Microsoft XML files to plain text and 64 00:03:44,800 --> 00:03:45,760 it gives you more information. 65 00:03:45,760 --> 00:03:50,950 Doc Doctor TXT is a tool that attempts to generate equivalent ASCII text files from the Microsoft Doc 66 00:03:50,950 --> 00:03:51,670 X documents. 67 00:03:51,760 --> 00:03:51,930 Okay. 68 00:03:52,000 --> 00:03:53,800 And you can read that if you wish. 69 00:03:53,800 --> 00:03:53,980 Okay. 70 00:03:54,040 --> 00:04:01,150 So you can see by using apt cash show, we can see plenty of information about the doc x to text package. 71 00:04:01,660 --> 00:04:04,180 So that's a really useful ability there. 72 00:04:04,210 --> 00:04:05,440 Now let me show you something. 73 00:04:05,440 --> 00:04:07,900 So we've done all that with access to the Internet, right? 74 00:04:07,900 --> 00:04:12,040 So if I click up here, you can see that I've got a connected Internet connection. 75 00:04:12,040 --> 00:04:16,209 Well, let me try and disconnect my virtual machine from the Internet and try that again. 76 00:04:16,209 --> 00:04:17,589 So I'm going to turn off my connection. 77 00:04:17,589 --> 00:04:20,680 And you can see now I've got no Internet connection whatsoever. 78 00:04:20,680 --> 00:04:24,790 If I open up Firefox and we'll probably see it, tell us that there's no internet connection. 79 00:04:24,790 --> 00:04:32,650 If I go to somewhere like, I don't know, let's say YouTube.com, it'll tell me that the server's not 80 00:04:32,650 --> 00:04:33,020 found, okay? 81 00:04:33,070 --> 00:04:34,390 Because there's no Internet connection. 82 00:04:34,750 --> 00:04:38,200 So with that, let's try and do it again. 83 00:04:38,200 --> 00:04:38,710 Okay. 84 00:04:38,740 --> 00:04:41,200 Let's search for the term web server. 85 00:04:41,470 --> 00:04:49,300 So if I do apt cache search and I want the term web server because there's, because there's two words 86 00:04:49,300 --> 00:04:52,300 in here, I'm going to enclose them in quotes here. 87 00:04:52,570 --> 00:04:57,070 So they go as one search term rather than two separate search terms. 88 00:04:57,070 --> 00:05:02,740 If I didn't have quotes and I did web server, it says If I search for web on its own and then server 89 00:05:02,740 --> 00:05:05,740 on its own, but I want to search for web server together. 90 00:05:05,770 --> 00:05:07,960 Okay, so apt cache search. 91 00:05:08,470 --> 00:05:10,420 And you see we get actually a whole bunch of results. 92 00:05:10,420 --> 00:05:14,860 So let me clear the screen and pipe that through less to make it a bit easier to handle. 93 00:05:15,970 --> 00:05:16,720 But actually. 94 00:05:16,720 --> 00:05:17,580 Wait a second. 95 00:05:17,590 --> 00:05:18,570 Isn't that quite strange? 96 00:05:18,580 --> 00:05:24,130 How was apt able to search for all these packages without having any internet connection? 97 00:05:24,970 --> 00:05:25,220 Hmm. 98 00:05:25,360 --> 00:05:31,780 And there appears to be a package here called Apache two that gives us the very popular Apache Web server. 99 00:05:31,900 --> 00:05:34,960 Okay, so let's try and get more information about that. 100 00:05:35,230 --> 00:05:36,730 So it's called Apache two. 101 00:05:36,760 --> 00:05:43,150 Let's do apt cash show Apache two and pipe that through less just to make it a bit easier to read. 102 00:05:43,420 --> 00:05:48,850 And yeah, we managed to get information about that, how strange it was to even get detailed information 103 00:05:48,850 --> 00:05:49,750 about the package. 104 00:05:50,950 --> 00:05:53,920 So how is that possible if we don't have an Internet connection? 105 00:05:54,190 --> 00:05:58,210 Well, if the information is not stored on the Internet and it's not being downloaded from the Internet, 106 00:05:58,210 --> 00:06:00,790 then it must be stored somewhere on this computer. 107 00:06:01,120 --> 00:06:02,110 And it is. 108 00:06:02,110 --> 00:06:05,560 So this information is stored in something called a cache. 109 00:06:05,590 --> 00:06:06,820 Now, what's a cache? 110 00:06:06,910 --> 00:06:11,130 Well, having come across, you may have come across the word cache when browsing websites and you know 111 00:06:11,170 --> 00:06:12,730 when your browser gets a bit slow. 112 00:06:12,730 --> 00:06:16,860 So you decide to clear out your browser's cache to speed up performance. 113 00:06:16,870 --> 00:06:17,830 But what is a cache? 114 00:06:17,830 --> 00:06:23,110 Exactly what a cache is a kind of storage place for information that's supposed to be efficient and 115 00:06:23,110 --> 00:06:24,310 easy to access. 116 00:06:24,430 --> 00:06:27,040 To explain this, let me tell you a little story. 117 00:06:27,040 --> 00:06:33,520 So let's say that you wanted to keep looking at a certain website and it was called w-w-what awesome 118 00:06:33,520 --> 00:06:35,730 site dot com. 119 00:06:36,220 --> 00:06:41,200 Now without a cache, every time that you wanted to visit awesome site, your computer would send a 120 00:06:41,200 --> 00:06:47,440 request all the way across the Internet to a computer known as a web server that holds all the files 121 00:06:47,440 --> 00:06:50,050 for w-w-what or sitcom. 122 00:06:50,860 --> 00:06:54,040 And this web server could potentially be across the other side of the world. 123 00:06:54,040 --> 00:06:56,950 And sending messages back and forth can take some time. 124 00:06:57,190 --> 00:07:01,840 But let's say that you visit awesome site and your computer sends a message all the way to the web server 125 00:07:01,840 --> 00:07:04,180 that happens to be on the other side of the world. 126 00:07:04,480 --> 00:07:10,510 After its long journey, your request arrives and it waits patiently in line behind all of the other 127 00:07:10,510 --> 00:07:12,760 requests that have arrived there first. 128 00:07:12,880 --> 00:07:17,050 So after dealing with all the other requests and that have come before you in the queue, the web server 129 00:07:17,050 --> 00:07:18,430 will ask, How can I help? 130 00:07:18,430 --> 00:07:22,210 And your request would say, Can you give me a copy of your home page, please? 131 00:07:22,480 --> 00:07:23,660 And the web server would reply. 132 00:07:23,680 --> 00:07:24,100 Sure. 133 00:07:24,130 --> 00:07:25,070 Let me find it for you. 134 00:07:25,090 --> 00:07:29,920 It's such as ran for a little while and then goes, Oh, here you go, and transmits bit by bit a copy 135 00:07:29,920 --> 00:07:34,540 of that file all the way back to your computer, over the internet, across the entire world. 136 00:07:35,140 --> 00:07:37,840 Now, you can imagine the whole process might take a bit of time, wouldn't it? 137 00:07:38,080 --> 00:07:44,170 Now, without a cache, the next time that you want to access WWE or some sitcom, the same thing happens 138 00:07:44,170 --> 00:07:45,430 all over again. 139 00:07:45,430 --> 00:07:49,660 Your request travels to the side of the world, wait in line and the file is sent bit by bit all the 140 00:07:49,660 --> 00:07:51,010 way back across the world. 141 00:07:51,130 --> 00:07:54,070 And this happens again and again and again. 142 00:07:54,550 --> 00:07:59,950 Now, imagine that it's not just you, but thousands or even millions of people all at the same time 143 00:07:59,950 --> 00:08:02,530 requesting awesome sitcom. 144 00:08:02,560 --> 00:08:04,230 I mean, it is awesome, after all. 145 00:08:04,240 --> 00:08:09,220 And if everyone in the world has to do the same process over and over and over again, you can imagine 146 00:08:09,220 --> 00:08:11,740 that the web server might start to become a bit overburdened. 147 00:08:11,740 --> 00:08:13,020 The queues get really long. 148 00:08:13,030 --> 00:08:17,440 There's a backup on the data highway and your web experience just slows way down. 149 00:08:17,620 --> 00:08:20,320 So to fix this problem, that's where a cache comes in. 150 00:08:20,320 --> 00:08:21,260 That's why cache is come in. 151 00:08:21,290 --> 00:08:21,670 Okay. 152 00:08:21,670 --> 00:08:27,160 So instead of being sort of the only being one copy of the file stored on the web server instead the 153 00:08:27,160 --> 00:08:32,530 very first time your request comes back, your it will keep a copy on the local computer in what's called 154 00:08:32,530 --> 00:08:33,220 a cache. 155 00:08:33,370 --> 00:08:37,900 Now the cache is nothing more than a place to store files locally so that you get performance benefits 156 00:08:37,900 --> 00:08:38,409 later. 157 00:08:38,860 --> 00:08:43,360 Now, the second time that you want to visit, visit, awesome site, your computer doesn't need to 158 00:08:43,360 --> 00:08:45,070 shoot messages all over the internet. 159 00:08:45,280 --> 00:08:50,200 It realizes that awesome sitcoms files are already in your cache, and then it just looks in the cache 160 00:08:50,200 --> 00:08:53,680 on your computer locally and loads the page, which is much, much faster. 161 00:08:53,890 --> 00:08:58,320 Now the only issue is that the cache must be kept up to date with what's on the actual web server. 162 00:08:58,330 --> 00:09:01,570 Otherwise you'll keep viewing an outdated copy of the files. 163 00:09:02,230 --> 00:09:03,340 So that's what a cache is. 164 00:09:03,340 --> 00:09:08,020 Now that we understand what a cache is, we now understand the reason why the command is called apt 165 00:09:08,020 --> 00:09:08,770 cache. 166 00:09:09,220 --> 00:09:15,220 And when we run apt cache search, what we're doing is we're telling the app package manager to look 167 00:09:15,220 --> 00:09:19,070 inside the cache for any packages matching the text that you give it. 168 00:09:19,090 --> 00:09:25,930 So if we did apt cache search text, it's looking inside its cache for all packages that match the word 169 00:09:25,930 --> 00:09:26,710 text. 170 00:09:27,460 --> 00:09:36,010 And if we run apt cache show Apache two, it's going to look for the Apache two package in its cache 171 00:09:36,010 --> 00:09:38,650 and bring up all the information that it's got about it. 172 00:09:38,860 --> 00:09:40,760 So where is this cache then? 173 00:09:40,780 --> 00:09:47,200 Well, on ubuntu the cache is located at slash var slash apt slash lists. 174 00:09:47,200 --> 00:09:50,040 So if we seed into there, let's go ahead and take a look. 175 00:09:50,050 --> 00:09:58,560 Okay, slash var slash, apt slash, sorry, slash, var slash lib slash apt slash lists. 176 00:09:58,570 --> 00:10:00,490 Okay, so now we're in there. 177 00:10:00,490 --> 00:10:03,370 If we take a look, we can see there's a whole bunch of different lists in here. 178 00:10:03,370 --> 00:10:09,460 Let me just list them out into the last command and we can see that we've got a whole bunch of files 179 00:10:09,460 --> 00:10:12,580 in here that are actually just lists of packages. 180 00:10:12,700 --> 00:10:15,460 Now, these are the lists of all the packages available from. 181 00:10:15,500 --> 00:10:20,360 The repositories that have enabled on my system and the lists also cover specific type of packages. 182 00:10:20,390 --> 00:10:26,300 Let me let me clear the screen and let me just maximize it as well and list it out again. 183 00:10:26,300 --> 00:10:29,270 But piping it through the last command with the capital end option. 184 00:10:29,270 --> 00:10:33,320 And this allows us to have some line numbering which will make it a bit easier to explain what I'm talking 185 00:10:33,320 --> 00:10:33,820 about. 186 00:10:33,830 --> 00:10:34,490 So here we are. 187 00:10:34,490 --> 00:10:37,500 We've now got each of the lines with some line numbering. 188 00:10:37,700 --> 00:10:44,990 Now you can see that there's so many different lists in this folder, each with a specific, each containing 189 00:10:44,990 --> 00:10:50,480 list of a specific type of package, depending upon where it came from and what type of computer architecture 190 00:10:50,480 --> 00:10:51,080 it's for. 191 00:10:51,260 --> 00:10:56,260 Now, a lot of mine start with the GB dot archive ubuntu dot com. 192 00:10:56,780 --> 00:11:04,280 Now that's because my nearest Ubuntu archive server will be in the UK because I'm based from the UK. 193 00:11:04,310 --> 00:11:04,510 Okay. 194 00:11:04,580 --> 00:11:08,660 In GB is for Great Britain and because I'm in the UK, that's where it sends its requests because it's 195 00:11:08,660 --> 00:11:12,170 a bit more efficient to send your requests to a server that's closer to you. 196 00:11:12,170 --> 00:11:14,750 But yours might be different depending upon where you are in the world. 197 00:11:14,750 --> 00:11:20,870 Okay, so if you're in the US it might say something like US, dot archive, dot com and so on. 198 00:11:20,870 --> 00:11:22,970 So don't worry about not having GB there. 199 00:11:23,240 --> 00:11:25,640 Everything else should be more or less the same though. 200 00:11:25,880 --> 00:11:31,880 Now on line three, there's a list of available artful packages. 201 00:11:31,880 --> 00:11:38,570 So for the artful code name version of Ubuntu, you can see that we've got the binary packages. 202 00:11:38,570 --> 00:11:44,360 So the pre compiled packages that are for the AMD 64 computer architecture from the main repository. 203 00:11:44,360 --> 00:11:44,750 Okay. 204 00:11:44,900 --> 00:11:51,200 And if we take a look online 15, we can see that we've got again for the artful version, we've got 205 00:11:51,200 --> 00:11:58,880 the binary pre compiled packages for the AMD 64 computer architecture, so 64 bit architecture with 206 00:11:58,880 --> 00:12:00,140 from the restricted repository. 207 00:12:00,140 --> 00:12:02,810 And you can see here we've got some from multiverse and so on. 208 00:12:03,080 --> 00:12:08,630 So the lists are broken up very specifically by where they came from and what they're for. 209 00:12:08,660 --> 00:12:09,090 Okay. 210 00:12:09,110 --> 00:12:13,340 Now these are not the packages that are installed on my computer, but they are the packages that are 211 00:12:13,340 --> 00:12:16,640 available in the software repositories that I've chosen to access. 212 00:12:16,640 --> 00:12:21,110 So these I don't like these aren't lists of packages that I have installed, but are lists of packages 213 00:12:21,110 --> 00:12:23,780 that I could install from the software repositories. 214 00:12:23,780 --> 00:12:24,150 Okay. 215 00:12:24,230 --> 00:12:28,880 So let's take a just take a quick look at one of these files that ends at entry. 216 00:12:28,910 --> 00:12:29,270 Okay. 217 00:12:29,300 --> 00:12:34,610 So let's say that we want to edit the entry for the GCC package that we downloaded a couple of videos 218 00:12:34,610 --> 00:12:35,120 ago. 219 00:12:35,360 --> 00:12:41,510 Well, we know that it's going to be in the main repository because it's open source and it's free software, 220 00:12:41,510 --> 00:12:43,520 but it's not maintained by the community. 221 00:12:43,520 --> 00:12:46,250 So we know that GCC should be the main repository. 222 00:12:46,250 --> 00:12:50,150 We also know that it's pre compiled and it's therefore a binary package. 223 00:12:50,420 --> 00:12:52,880 We didn't have to download GTC and then compile it. 224 00:12:52,880 --> 00:12:56,120 We just installed it straight away in the last few videos, which means it's pre compiled. 225 00:12:56,240 --> 00:13:04,610 So if we look for the list that we see, that's for art for main directory, main repository with a 226 00:13:04,610 --> 00:13:07,550 preconfigured preconfigured 64 bit binaries. 227 00:13:07,560 --> 00:13:08,420 Now let's have a look for that. 228 00:13:08,420 --> 00:13:15,620 So we've got artful and we see four main here we are main binary AMD 64. 229 00:13:15,620 --> 00:13:17,690 So it should be in this list. 230 00:13:17,690 --> 00:13:25,310 So if I just copy that and I add this and I open that up with Nano, so I do nano and paste that if 231 00:13:25,310 --> 00:13:25,880 I can. 232 00:13:27,230 --> 00:13:27,800 There we go. 233 00:13:27,800 --> 00:13:32,690 So now if I press enter, you can see that we've opened the list and we've got a whole bunch of different 234 00:13:32,690 --> 00:13:33,800 packages in here. 235 00:13:33,800 --> 00:13:38,900 And you can see that this is starting to look like the results from APT Cash Show and that's exactly 236 00:13:38,900 --> 00:13:39,680 what happens. 237 00:13:39,680 --> 00:13:45,380 That cache show will just search through the files and print out the the information regarding that 238 00:13:45,380 --> 00:13:46,040 package. 239 00:13:46,040 --> 00:13:52,460 So now that we're in this file, why don't we just go ahead and search for the package called DCC? 240 00:13:52,460 --> 00:13:56,510 So the way we can find that a bit easier, instead of just searching for GCC, you can notice that the 241 00:13:56,510 --> 00:14:02,090 actual package bit starts with the word package, then a colon, then a space, then the actual package 242 00:14:02,090 --> 00:14:02,300 name. 243 00:14:02,300 --> 00:14:03,770 So let's try and do that for GCC. 244 00:14:03,770 --> 00:14:07,700 So we're going to do package colon space, GCC. 245 00:14:07,940 --> 00:14:12,440 And if I press enter, we'll see that we've ended up at the GCC package and you can see that we get 246 00:14:12,440 --> 00:14:16,970 all the information about the GCC package that we installed a few minutes ago. 247 00:14:16,970 --> 00:14:17,190 Okay. 248 00:14:17,240 --> 00:14:19,940 In the last video or so and it comes up. 249 00:14:19,940 --> 00:14:29,150 So let's change the priority from saying optional here to saying optional, but awesome. 250 00:14:29,300 --> 00:14:29,810 Okay. 251 00:14:29,810 --> 00:14:36,140 So if I if I save that right, that file opens it same permission denied because this is a special file 252 00:14:36,140 --> 00:14:37,790 we need to open it with sudo. 253 00:14:37,820 --> 00:14:38,090 Okay. 254 00:14:38,120 --> 00:14:44,390 So it's open it with sudo nano where you can do that as just press the up arrow key, then type sudo 255 00:14:44,390 --> 00:14:45,980 at the beginning and enter your password. 256 00:14:46,640 --> 00:14:51,920 Then we're going to search for package package colon DCC. 257 00:14:52,220 --> 00:14:52,850 There we are. 258 00:14:52,880 --> 00:14:59,720 Then instead of having it say optional, we're going to have it say optional, but awesome with an exclamation 259 00:14:59,720 --> 00:14:59,930 mark. 260 00:14:59,930 --> 00:15:02,690 Of course, save the file and exit. 261 00:15:02,690 --> 00:15:05,540 Okay, now, if we just close the terminal and open it up again. 262 00:15:05,540 --> 00:15:13,430 Okay, now if we do apt cash show GCC and maximize the term a little bit and pipe that through less. 263 00:15:15,850 --> 00:15:20,860 We can see here that it's pulled the information for GCSE and now the priority is optional but awesome, 264 00:15:20,860 --> 00:15:21,770 which is fantastic. 265 00:15:21,820 --> 00:15:23,560 Okay, how cool is that? 266 00:15:23,560 --> 00:15:29,410 So you can see here that what's actually happening is you've got a cache, a I guess a place, a folder 267 00:15:29,410 --> 00:15:34,240 on your computer that stores lists that your package manager can search through regardless of whether 268 00:15:34,240 --> 00:15:35,820 you've got Internet connection or not. 269 00:15:35,830 --> 00:15:44,140 And that is located at slash, var, slash, lib, slap, slash, apt slash lists. 270 00:15:44,530 --> 00:15:48,430 So if we go, that's a massive difficulty to say if you're looking there, you've got all these different 271 00:15:48,430 --> 00:15:51,490 lists, each for specific purposes. 272 00:15:51,820 --> 00:15:57,220 And because we wanted to look for the GCC package, we used a little bit of our understanding of repositories 273 00:15:57,220 --> 00:16:02,920 to understand that the GCSE package would be located in the main repository because it's, it's probably 274 00:16:02,920 --> 00:16:09,580 it's maintained by Canonical because it's so old you see, and you've got the, it's pre compiled, 275 00:16:09,580 --> 00:16:14,740 it's ready to go so it's going to be binary and we are on an amd64 computer architecture. 276 00:16:14,740 --> 00:16:16,360 So that's the list that we're looking at. 277 00:16:16,360 --> 00:16:20,530 So we kind of took this, this file here, this file name which is very long, but it's a file name 278 00:16:20,530 --> 00:16:21,310 nonetheless. 279 00:16:21,310 --> 00:16:30,220 And we took a look at it with Nano and we opened it up and we are, oops, I need to enter my password. 280 00:16:30,220 --> 00:16:37,450 So we opened it up and we saw that this is where when you try to show more information about a package, 281 00:16:37,450 --> 00:16:42,470 the package manager gets this information and we looked for the GCC package, okay? 282 00:16:42,550 --> 00:16:44,800 And we found out that this is where it is. 283 00:16:44,800 --> 00:16:49,900 And then we edited some of that information to demonstrate that this is exactly where the information 284 00:16:49,900 --> 00:16:50,650 is coming from. 285 00:16:50,650 --> 00:16:59,320 So if we now look at APT cash show GCSE, we can see that now that information is no longer optional, 286 00:16:59,320 --> 00:17:00,940 but awesome, but it's just optional. 287 00:17:01,180 --> 00:17:05,140 So now you can see a bit behind the scenes how your package manager is working. 288 00:17:06,230 --> 00:17:11,569 So now we understand that for performance benefits, Aptx saves a cache of all available among two packages 289 00:17:11,569 --> 00:17:19,940 on your local system in the slash via slash lib slash apt slash lists directory, and that's called 290 00:17:19,940 --> 00:17:21,410 the apt cash. 291 00:17:21,740 --> 00:17:28,430 That folder is called the APT Cash and by searching the APT cash using APT cash search and that a search 292 00:17:28,430 --> 00:17:35,810 term apt will search all of the lists in those in that cash in that folder for any package names that 293 00:17:35,810 --> 00:17:38,450 have something to do with that search term. 294 00:17:38,450 --> 00:17:43,280 So it'll search the package name and the package description in all of those lists and return to you 295 00:17:43,280 --> 00:17:47,810 the package names with a little snippet, a little description of each package, so that you can look 296 00:17:47,810 --> 00:17:48,920 for more information if you want. 297 00:17:48,920 --> 00:17:53,630 And you would look for more information using APT Cash show and then the package name that APT Cash 298 00:17:53,630 --> 00:17:55,070 search would give you back. 299 00:17:55,070 --> 00:17:58,070 And this will show you detailed information about the package. 300 00:17:58,070 --> 00:17:58,310 Okay. 301 00:17:58,370 --> 00:18:02,960 Things for anything from the size of it to a description to what it does, who the maintainers are, 302 00:18:02,960 --> 00:18:06,680 where to report bugs and everything that you could possibly know about that package. 303 00:18:06,680 --> 00:18:11,390 Now, all of this is done using lists that are installed in the cache. 304 00:18:11,390 --> 00:18:17,780 So lists are downloaded to the slash via slash lib slash apt slash lists folder. 305 00:18:18,320 --> 00:18:23,930 And all of those files in there are just lists of packages and they all have basically the same format, 306 00:18:23,930 --> 00:18:30,620 but that's where everything is saved and it just uses the lists in that folder to produce all this functionality. 307 00:18:30,620 --> 00:18:35,270 But this makes us wonder how did the lists actually get into the cache in the first place? 308 00:18:35,390 --> 00:18:39,710 And just like any cache, it must be kept up to date, otherwise new packages could be released and 309 00:18:39,710 --> 00:18:40,370 you wouldn't know. 310 00:18:40,370 --> 00:18:42,110 So how do we keep the cache up to date? 311 00:18:42,320 --> 00:18:43,310 Well, you're in luck. 312 00:18:43,310 --> 00:18:46,940 These questions and many more will be answered in the next video.