My AppCenter has an icon indicating several updates in the queue. How can I download and install these updates from Terminal/CLI without opening AppCenter?
The new apt
tool has been in Ubuntu since 14.04. apt(8)
describes it thus:
The apt command is meant to be pleasant for end users and does not need to be backward compatible like apt-get(8).
To update your system with apt
is as simple as:
sudo apt update
sudo apt full-upgrade
apt-get
is functionally very similar to apt
, so there is nothing wrong with using it. Prashantc's answer is mostly correct, however will fall short if an updated package requires additional packages. If you are using apt-get
, unless you have a specific reason for not upgrading certain packages, you should use:
sudo apt-get update
sudo apt-get dist-upgrade
The classic example, being that sudo apt-get upgrade
will fail to update linux-image-generic
as this needs to bring in a new dependency (i.e. linux-image-3.16.0-25-generic
). dist-upgrade
on the other hand handles changing dependencies with new versions of packages.
If you want something a little more interactive, you can use the Ncurses-based aptitude
(installed by default), which is a frontend to apt
:
sudo aptitude
Press u
to update the latest package list, and then g
to install updates.
You can find more information about aptitude
here.
-
Sidenote,
apt
is a more recent version ofapt-get
, and also is more comfortable to use, see here – Nicola Liguori Sep 21 '16 at 11:01 -
As a complement to the main answer - to do it from Slingshot:
scratch-text-editor ~/.local/share/applications/apt-update.desktop
paste this:
[Desktop Entry]
Type=Application
Name=update
Icon=system-software-install
Categories=Utility;
Exec=pantheon-terminal -e 'sudo apt update && sudo apt full-upgrade'