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.
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.apt-get upgrade
will fetch new versions of packages existing on the machine if APT knows about these new versions by way ofapt-get update
.apt-get dist-upgrade
will do the same job which is done byapt-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:
1 |
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:
1 |
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).
1 |
sudo apt-get update --fix-missing; |
1 |
apt-get --help |