How to install updates and upgrade Ubuntu
apt-get is the command-line interface to the package handling utility. It has an update option to ensure the local package index files are in sync with the source of any locally installed packages. After updating the index files, you use the upgrade option to physically install newer versions of any installed packages. If running apt-get as anyone besides root, make sure to use sudo to execute the command as a superuser.
DIFFICULTY | Basic - 1 | Medium - 2 | Advanced - 3 |
TIME REQUIRED | 10 min |
RELATED PRODUCTS | Ubuntu-based VPS or dedicated servers |
Once you decide its time to upgrade any locally installed packages, you can use apt to do so.
$ sudo apt-get update
[sudo] password for username: Hit http://security.ubuntu.com precise-security Release.gpg Hit http://us.archive.ubuntu.com precise Release.gpg Get:1 http://us.archive.ubuntu.com precise-updates Release.gpg [198 B] Hit http://us.archive.ubuntu.com precise-backports Release.gpg Hit http://security.ubuntu.com precise-security Release Hit http://us.archive.ubuntu.com precise Release Get:2 http://us.archive.ubuntu.com precise-updates Release [98.7 kB] ...
Wait for the index files to be updated, then upgrade outdated packages:
[sudo] password for username: Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: accountsservice apport aptitude autofs autofs5 base-files bash-completion bc bsdutils dmidecode dmsetup dosfstools efibootmgr grub-common grub-efi grub-efi-amd64 grub-efi-amd64-bin grub2-common ifupdown iproute iptables isc-dhcp-client isc-dhcp-common landscape-common language-pack-en language-pack-en-base libaccountsservice0 libasn1-8-heimdal libavahi-client3 libavahi-common-data ... After this operation, 86.0 kB of additional disk space will be used. Do you want to continue [Y/n]?
You then must answer the prompt with a Y, and off it goes.
Extracting templates from packages: 100% Preconfiguring packages ... Setting up base-files (6.5ubuntu6.8) ... Installing new version of config file /etc/issue ... Installing new version of config file /etc/issue.net ...
Then just wait for everything to update.
An optional additional command you can execute is autoremove. This will remove dependency packages that are no longer needed after upgrading, freeing space.