Hello, you beautiful people.
So in the last video I left you with kind of a cliffhanger with some burning questions that we have
about how our apt package manager works, how does the cash get there in the first place, and how can
we make sure that the cash is kept up to date?
Well, these are the questions that we'll be answering in this video.
By the end of this video, you'll know how to update your cash.
And you also know how to use that cash to upgrade all of the software on your system to the most up
to date level with one simple command.
Now, this is going to be so awesome and I am sure that you you'll begin to see why package managers
are far superior to the simple wizards that you may be used to using.
Now, I can't wait to show you this stuff, so let's just go ahead and get right into it.
Okay.
So how do the lists in the cash actually get there in the first place?
Well, these lists are actually downloaded from servers somewhere on the Internet, and these servers
are maintained by credible sources and contain up to date lists of all existing packages.
And as we mentioned in the last video, in order for a cash to be functional, the files in the cache
must be the same as the files on the server.
Now this is especially important for the software repositories, so think with me about the GNU Linux
community for a moment.
There are millions of people around the world all contributing to this massive body of software and
creating things all the time.
This massive body of people contributing simultaneously to the software repositories and projects means
its software changes a lot, and it changes often.
Bugs get fixed, security holes get patched, new features get added, documentation gets clarified,
and so on and so forth.
Now sometimes programs get developed so much that they require new dependencies in order to work.
And in spite all of these changes, keeping all the software on your system up to date and managing
everything yourself manually would just be a complete nightmare.
It just wouldn't work.
There's too much room for a person to make a mistake and too much stuff to keep track of.
But fortunately you don't have to.
The APT package manager has a way of using the cache to make sure that all the software on your system
is completely up to date.
And here's how it works.
So the first thing you need to do is to update your cache and to do that you'd run sudo apt get update
and that's the command you'd run.
Now notice how we need to use the sudo command at the beginning here.
Now that's because we're going to make changes to important files in our file system and we need administrator
privileges in order to do so.
And instead of apt cash we're using apt get because we're going to get data from the repositories.
So we'll be getting the updated lists and update we'll update the the lists in our cash to make sure
that the package versions in there are the same as the packaged versions in the repositories.
But of course, in order for this to work, we need to be connected to the internet.
So I re enabled our internet connection before recording this video.
So if you are following along, make sure you re-enable yours too.
And if we run that so sudo apt get update, it'll ask us to enter our password because we're using the
sudo command.
So we enter that and we press enter and you can see that it's getting loads of different lists from
the Ubuntu repositories and it's downloading them and installing them.
Now it's going to be updating our cache which might take a various amount of time depending on how long
it's been since you've updated.
But ours is gone and completed now.
So now that we've updated that, our cache will have the most up to date package numbers and dependencies
for all the packages in our cache.
So now that we have an up to date cache, what if some of the software on our computer is out of date?
How can we upgrade our software to the newest versions that are in the new versions of the package lists?
Well, that's actually really easy and quite magical, to be honest.
So to upgrade every single piece of software on your system that you installed from the repositories,
all you need to do is type in.
If I click the screen sudo apt get upgrade.
Now this will run through.
So if I press enter, this will run through all the package lists and see all the software that we've
got on our system and it will tell us what's out of date and what needs to be updated.
And it will also tell you how much needs to be installed and so on, and it asks for our permission
to continue.
So if I press yes.
So this is going to run through the updated cache and see what packages on your system are behind and
then figure out what new dependencies need to be installed and which ones are no longer required.
And it'll tell you how much space is required.
And so and so before asking your permission to continue.
But now that we've given it permission, it will go ahead and start updating every piece of software
on the system.
So it will download the required packages, unpack them, install them, and remove the old versions
all automatically for every single piece of software on the entire system that was installed using the
repository.
So this is an incredibly powerful automated system and this is really the beauty of using a package
manager.
You don't have to go to the website and download manually each piece, each new package like you might
have to do on Windows or Mac, or you've got to download the new installer or click for updates on each
different piece of software.
Now all you've got to do is run sudo update upgrade and everything that was installed through the repositories
will be upgraded to the newest version levels, which helps you with security.
It helps you with having the most modern features.
And it's just absolutely amazing and.
Also, if you use a crumb, you can schedule this stuff to happen on a regular basis as well.
So that's a useful thing to bear in mind.
Now, this might take a varying amount of time, depending upon how long it's been since since we've
upgraded our software and because I haven't actually done it on this virtual machine.
So it will take quite a while.
So what I'm going to do is I'm going to cut the video here and come back when it is done.
And just like that in two commands, all the software on our system has been upgraded and we can actually
see that the Firefox logo has been updated to look a whole lot more epic.
So notice how the system also didn't need to reboot.
All the software that we've installed through the repositories has been upgraded and it's ready to go.
So all we had to do was update the package list using sudo apt get update and then once we'd updated
it or what to do with sudo apt get upgrade and then we upgraded all of the software to the new versions.
So do note that sometimes you will need to reboot your system when you do these updates.
But this is kind of unusual, but sometimes it will need to happen.
But it's important to note that you should always update your cache before you perform an upgrade,
and this makes sure that the upgrade occurs using the correct software versions and everything is updated
uniformly.
So to update your cache you've run sudo apt get update.
And what this will do is it will download the most updated versions of the package lists from the Ubuntu
servers into your cache that is stored on your computer.
So in order to do that, you need to have an internet connection.
But once you've updated your cache by downloading the most updated package lists, you can upgrade all
of the software on your system using sudo apt get upgrade.
And what this will do is it will make the package manager look at all the software that is currently
on your system and compare it to what is available in the package lists.
And then the package manager will automatically download and upgrade all the different packages that
can be downloaded in order to update your system to the most up to date level.
So this will download any new versions of packages.
It will remove old versions, it'll download any new required dependencies.
And this just helps you increase your system security.
It helps give you maximum functionality, and it's all around just fantastic.
But something that you need to bear in mind is that you need to update the cache before you upgrade
because otherwise you'll be upgrading all your software to not the most up to date versions and you
want to be able to update your software to the most up to date versions.
In order to do that, you need to have up to date package lists.
So to update those lists, you update your cache, and then when you've updated your cache, you can
upgrade your software.
So bear that in mind.
Always update your cache before you upgrade your software.
Another important thing to bear in mind here is that you can only upgrade software that was installed
through the repositories.
Now it is possible on a new Linux system like we did in the previous videos where we modified the RLS
command that you can download packages, manually extract them and compile them and install them yourself.
But because that process doesn't happen through the repositories and package manager, you lose the
ability to keep them up to date like we are doing here.
So therefore, if you can download a package from a website and you can also get it from the Ubuntu
repositories, make sure to get it from the repositories because then you can make sure that it's up
to date and make sure you always have the best features available using this automated process.
So as of now, we've discussed how to search for software, how to update caches and how to upgrade
software.
But we haven't discussed how to actually install new software.
Well, with all the understanding that you have now, that's actually going to be really easy for you.
So I'll save that little gem for the next video.