1 00:00:00,090 --> 00:00:01,460 Hello, you beautiful people. 2 00:00:01,470 --> 00:00:05,520 So in the last video I left you with kind of a cliffhanger with some burning questions that we have 3 00:00:05,520 --> 00:00:10,440 about how our apt package manager works, how does the cash get there in the first place, and how can 4 00:00:10,440 --> 00:00:12,360 we make sure that the cash is kept up to date? 5 00:00:12,390 --> 00:00:15,510 Well, these are the questions that we'll be answering in this video. 6 00:00:15,510 --> 00:00:18,180 By the end of this video, you'll know how to update your cash. 7 00:00:18,180 --> 00:00:23,100 And you also know how to use that cash to upgrade all of the software on your system to the most up 8 00:00:23,100 --> 00:00:25,560 to date level with one simple command. 9 00:00:25,680 --> 00:00:30,600 Now, this is going to be so awesome and I am sure that you you'll begin to see why package managers 10 00:00:30,600 --> 00:00:34,570 are far superior to the simple wizards that you may be used to using. 11 00:00:34,590 --> 00:00:38,070 Now, I can't wait to show you this stuff, so let's just go ahead and get right into it. 12 00:00:38,730 --> 00:00:39,150 Okay. 13 00:00:39,150 --> 00:00:42,810 So how do the lists in the cash actually get there in the first place? 14 00:00:42,840 --> 00:00:47,340 Well, these lists are actually downloaded from servers somewhere on the Internet, and these servers 15 00:00:47,340 --> 00:00:52,580 are maintained by credible sources and contain up to date lists of all existing packages. 16 00:00:52,590 --> 00:00:57,180 And as we mentioned in the last video, in order for a cash to be functional, the files in the cache 17 00:00:57,180 --> 00:00:59,520 must be the same as the files on the server. 18 00:00:59,550 --> 00:01:04,200 Now this is especially important for the software repositories, so think with me about the GNU Linux 19 00:01:04,200 --> 00:01:05,330 community for a moment. 20 00:01:05,340 --> 00:01:10,140 There are millions of people around the world all contributing to this massive body of software and 21 00:01:10,140 --> 00:01:11,970 creating things all the time. 22 00:01:12,330 --> 00:01:17,010 This massive body of people contributing simultaneously to the software repositories and projects means 23 00:01:17,010 --> 00:01:19,530 its software changes a lot, and it changes often. 24 00:01:19,620 --> 00:01:24,360 Bugs get fixed, security holes get patched, new features get added, documentation gets clarified, 25 00:01:24,360 --> 00:01:25,620 and so on and so forth. 26 00:01:25,770 --> 00:01:30,720 Now sometimes programs get developed so much that they require new dependencies in order to work. 27 00:01:30,720 --> 00:01:34,770 And in spite all of these changes, keeping all the software on your system up to date and managing 28 00:01:34,770 --> 00:01:38,700 everything yourself manually would just be a complete nightmare. 29 00:01:39,150 --> 00:01:40,170 It just wouldn't work. 30 00:01:40,170 --> 00:01:44,410 There's too much room for a person to make a mistake and too much stuff to keep track of. 31 00:01:44,430 --> 00:01:46,410 But fortunately you don't have to. 32 00:01:46,440 --> 00:01:51,450 The APT package manager has a way of using the cache to make sure that all the software on your system 33 00:01:51,450 --> 00:01:52,770 is completely up to date. 34 00:01:52,770 --> 00:01:54,120 And here's how it works. 35 00:01:54,480 --> 00:02:01,860 So the first thing you need to do is to update your cache and to do that you'd run sudo apt get update 36 00:02:02,190 --> 00:02:03,420 and that's the command you'd run. 37 00:02:03,450 --> 00:02:07,650 Now notice how we need to use the sudo command at the beginning here. 38 00:02:07,680 --> 00:02:12,420 Now that's because we're going to make changes to important files in our file system and we need administrator 39 00:02:12,420 --> 00:02:14,010 privileges in order to do so. 40 00:02:14,040 --> 00:02:20,040 And instead of apt cash we're using apt get because we're going to get data from the repositories. 41 00:02:20,040 --> 00:02:26,910 So we'll be getting the updated lists and update we'll update the the lists in our cash to make sure 42 00:02:26,910 --> 00:02:31,490 that the package versions in there are the same as the packaged versions in the repositories. 43 00:02:31,500 --> 00:02:34,410 But of course, in order for this to work, we need to be connected to the internet. 44 00:02:34,410 --> 00:02:38,280 So I re enabled our internet connection before recording this video. 45 00:02:38,280 --> 00:02:40,940 So if you are following along, make sure you re-enable yours too. 46 00:02:40,950 --> 00:02:46,290 And if we run that so sudo apt get update, it'll ask us to enter our password because we're using the 47 00:02:46,290 --> 00:02:46,920 sudo command. 48 00:02:46,920 --> 00:02:53,130 So we enter that and we press enter and you can see that it's getting loads of different lists from 49 00:02:53,130 --> 00:02:56,730 the Ubuntu repositories and it's downloading them and installing them. 50 00:02:56,730 --> 00:03:01,410 Now it's going to be updating our cache which might take a various amount of time depending on how long 51 00:03:01,410 --> 00:03:02,700 it's been since you've updated. 52 00:03:02,700 --> 00:03:04,560 But ours is gone and completed now. 53 00:03:04,560 --> 00:03:09,870 So now that we've updated that, our cache will have the most up to date package numbers and dependencies 54 00:03:09,870 --> 00:03:12,740 for all the packages in our cache. 55 00:03:12,750 --> 00:03:17,360 So now that we have an up to date cache, what if some of the software on our computer is out of date? 56 00:03:17,370 --> 00:03:22,700 How can we upgrade our software to the newest versions that are in the new versions of the package lists? 57 00:03:22,710 --> 00:03:26,210 Well, that's actually really easy and quite magical, to be honest. 58 00:03:26,220 --> 00:03:30,870 So to upgrade every single piece of software on your system that you installed from the repositories, 59 00:03:30,870 --> 00:03:32,790 all you need to do is type in. 60 00:03:32,800 --> 00:03:37,380 If I click the screen sudo apt get upgrade. 61 00:03:38,190 --> 00:03:39,930 Now this will run through. 62 00:03:40,200 --> 00:03:45,960 So if I press enter, this will run through all the package lists and see all the software that we've 63 00:03:45,960 --> 00:03:50,610 got on our system and it will tell us what's out of date and what needs to be updated. 64 00:03:50,610 --> 00:03:55,620 And it will also tell you how much needs to be installed and so on, and it asks for our permission 65 00:03:55,620 --> 00:03:56,160 to continue. 66 00:03:56,160 --> 00:03:57,840 So if I press yes. 67 00:03:57,840 --> 00:04:03,190 So this is going to run through the updated cache and see what packages on your system are behind and 68 00:04:03,210 --> 00:04:07,410 then figure out what new dependencies need to be installed and which ones are no longer required. 69 00:04:07,410 --> 00:04:09,210 And it'll tell you how much space is required. 70 00:04:09,210 --> 00:04:11,850 And so and so before asking your permission to continue. 71 00:04:11,850 --> 00:04:17,100 But now that we've given it permission, it will go ahead and start updating every piece of software 72 00:04:17,100 --> 00:04:17,640 on the system. 73 00:04:17,640 --> 00:04:22,350 So it will download the required packages, unpack them, install them, and remove the old versions 74 00:04:22,350 --> 00:04:29,520 all automatically for every single piece of software on the entire system that was installed using the 75 00:04:29,520 --> 00:04:30,030 repository. 76 00:04:30,030 --> 00:04:35,010 So this is an incredibly powerful automated system and this is really the beauty of using a package 77 00:04:35,010 --> 00:04:35,670 manager. 78 00:04:36,030 --> 00:04:41,250 You don't have to go to the website and download manually each piece, each new package like you might 79 00:04:41,250 --> 00:04:45,600 have to do on Windows or Mac, or you've got to download the new installer or click for updates on each 80 00:04:45,600 --> 00:04:46,800 different piece of software. 81 00:04:46,830 --> 00:04:51,060 Now all you've got to do is run sudo update upgrade and everything that was installed through the repositories 82 00:04:51,060 --> 00:04:55,290 will be upgraded to the newest version levels, which helps you with security. 83 00:04:55,290 --> 00:04:57,780 It helps you with having the most modern features. 84 00:04:57,780 --> 00:04:59,940 And it's just absolutely amazing and. 85 00:05:00,000 --> 00:05:04,830 Also, if you use a crumb, you can schedule this stuff to happen on a regular basis as well. 86 00:05:04,830 --> 00:05:07,210 So that's a useful thing to bear in mind. 87 00:05:07,230 --> 00:05:11,760 Now, this might take a varying amount of time, depending upon how long it's been since since we've 88 00:05:11,760 --> 00:05:15,900 upgraded our software and because I haven't actually done it on this virtual machine. 89 00:05:15,900 --> 00:05:16,880 So it will take quite a while. 90 00:05:16,890 --> 00:05:20,010 So what I'm going to do is I'm going to cut the video here and come back when it is done. 91 00:05:21,410 --> 00:05:26,960 And just like that in two commands, all the software on our system has been upgraded and we can actually 92 00:05:26,960 --> 00:05:30,620 see that the Firefox logo has been updated to look a whole lot more epic. 93 00:05:30,890 --> 00:05:34,010 So notice how the system also didn't need to reboot. 94 00:05:34,010 --> 00:05:38,110 All the software that we've installed through the repositories has been upgraded and it's ready to go. 95 00:05:38,120 --> 00:05:45,050 So all we had to do was update the package list using sudo apt get update and then once we'd updated 96 00:05:45,050 --> 00:05:50,210 it or what to do with sudo apt get upgrade and then we upgraded all of the software to the new versions. 97 00:05:50,210 --> 00:05:54,560 So do note that sometimes you will need to reboot your system when you do these updates. 98 00:05:54,560 --> 00:05:57,320 But this is kind of unusual, but sometimes it will need to happen. 99 00:05:57,320 --> 00:06:01,940 But it's important to note that you should always update your cache before you perform an upgrade, 100 00:06:01,940 --> 00:06:07,490 and this makes sure that the upgrade occurs using the correct software versions and everything is updated 101 00:06:07,490 --> 00:06:08,450 uniformly. 102 00:06:09,770 --> 00:06:12,830 So to update your cache you've run sudo apt get update. 103 00:06:12,830 --> 00:06:17,870 And what this will do is it will download the most updated versions of the package lists from the Ubuntu 104 00:06:17,870 --> 00:06:21,500 servers into your cache that is stored on your computer. 105 00:06:21,500 --> 00:06:24,020 So in order to do that, you need to have an internet connection. 106 00:06:24,020 --> 00:06:29,330 But once you've updated your cache by downloading the most updated package lists, you can upgrade all 107 00:06:29,330 --> 00:06:32,870 of the software on your system using sudo apt get upgrade. 108 00:06:32,870 --> 00:06:36,410 And what this will do is it will make the package manager look at all the software that is currently 109 00:06:36,410 --> 00:06:40,160 on your system and compare it to what is available in the package lists. 110 00:06:40,160 --> 00:06:46,700 And then the package manager will automatically download and upgrade all the different packages that 111 00:06:46,700 --> 00:06:50,600 can be downloaded in order to update your system to the most up to date level. 112 00:06:50,600 --> 00:06:53,360 So this will download any new versions of packages. 113 00:06:53,360 --> 00:06:56,960 It will remove old versions, it'll download any new required dependencies. 114 00:06:56,960 --> 00:06:59,420 And this just helps you increase your system security. 115 00:06:59,420 --> 00:07:03,770 It helps give you maximum functionality, and it's all around just fantastic. 116 00:07:03,770 --> 00:07:08,360 But something that you need to bear in mind is that you need to update the cache before you upgrade 117 00:07:08,360 --> 00:07:13,190 because otherwise you'll be upgrading all your software to not the most up to date versions and you 118 00:07:13,190 --> 00:07:15,590 want to be able to update your software to the most up to date versions. 119 00:07:15,620 --> 00:07:18,080 In order to do that, you need to have up to date package lists. 120 00:07:18,080 --> 00:07:22,040 So to update those lists, you update your cache, and then when you've updated your cache, you can 121 00:07:22,040 --> 00:07:23,060 upgrade your software. 122 00:07:23,060 --> 00:07:23,840 So bear that in mind. 123 00:07:23,840 --> 00:07:26,780 Always update your cache before you upgrade your software. 124 00:07:26,870 --> 00:07:31,460 Another important thing to bear in mind here is that you can only upgrade software that was installed 125 00:07:31,460 --> 00:07:32,750 through the repositories. 126 00:07:33,170 --> 00:07:37,250 Now it is possible on a new Linux system like we did in the previous videos where we modified the RLS 127 00:07:37,280 --> 00:07:42,530 command that you can download packages, manually extract them and compile them and install them yourself. 128 00:07:42,530 --> 00:07:46,700 But because that process doesn't happen through the repositories and package manager, you lose the 129 00:07:46,700 --> 00:07:49,370 ability to keep them up to date like we are doing here. 130 00:07:49,670 --> 00:07:53,870 So therefore, if you can download a package from a website and you can also get it from the Ubuntu 131 00:07:53,870 --> 00:07:58,160 repositories, make sure to get it from the repositories because then you can make sure that it's up 132 00:07:58,160 --> 00:08:02,540 to date and make sure you always have the best features available using this automated process. 133 00:08:02,690 --> 00:08:07,490 So as of now, we've discussed how to search for software, how to update caches and how to upgrade 134 00:08:07,490 --> 00:08:08,000 software. 135 00:08:08,000 --> 00:08:11,120 But we haven't discussed how to actually install new software. 136 00:08:11,480 --> 00:08:15,260 Well, with all the understanding that you have now, that's actually going to be really easy for you. 137 00:08:15,260 --> 00:08:17,870 So I'll save that little gem for the next video.