Categories: Snippets

apt-get update

In a nutshell, apt-get update doesn’t actually install new versions of software. Instead, it updates the package lists for upgrades for packages that need upgrading, as well as new packages that have just come to the repositories.

  1. apt-get update downloads the package lists from the repositories and “updates” them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.
  2. apt-get upgrade will fetch new versions of packages existing on the machine if APT knows about these new versions by way of apt-get update.
  3. apt-get dist-upgrade will do the same job which is done by apt-get upgrade, plus it will also intelligently handle the dependencies, so it might remove obsolete packages or add new ones

You can combine commands with && as follows:

sudo apt-get update && sudo apt-get install foo bar baz foo-dev foo-dbg

or to get newest versions possible as per version requirements of dependencies:

sudo apt-get update && sudo apt-get dist-upgrade

You need sudo both times, but since sudo by default doesn’t prompt you within 5 or so minutes since the last sudo operation, you will be prompted for your password only once (or not at all).

sudo apt-get update --fix-missing;
apt-get --help

Recent Posts

How To Troubleshoot Socket Errors in MySQL – Ubuntu

MySQL manages connections to the database server through the use of a socket file, a special…

5 years ago

How to remove .html, .php, etc (extension) from URL?

To remove the .html extension from your urls, you can use the following code in…

5 years ago

Ubuntu with Apache2: Installing and Configuring Your SSL Certificate

Use free/paid SSL certificates https://www.sslforfree.com Enable SSL Module Replace 'default-ssl' with the real site name…

5 years ago

Create zip archive excluding specific Files & Directories

Create archive of all files under public_html directory ignoring all files and folders including text…

6 years ago

how to use sudo command to install .tar.gz?

To install some file *.tar.gz, you basically would do: Open a console, and go to…

6 years ago

Change ownership of the directory in ubuntu

The chown command has the following syntax: [crayon-663adf9d420c0451124445/] So in your example command it is your primary…

6 years ago