Why use apt-get upgrade instead of apt-get dist-upgrade?


apt-get update updates the list of available packages and their versions, but it does not install or upgrade any packages.

apt-get upgrade actually installs newer versions of the packages you have. After updating the lists, the package manager knows about available updates for the software you have installed. This is why you first want to update.

apt-get dist-upgrade, in addition to performing the function of apt-get upgrade, also intelligently handles changing dependencies with new versions of packages and will attempt to upgrade the most important packages at the expense of less important ones if necessary. Thus, the apt-get dist-upgrade command may actually remove some packages in rare but necessary...

0 0

If you want to update your os then this is it...

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


upgrade is used to install the newest versions of all packages

currently installed on the system from the sources enumerated in

/etc/apt/sources.list. Packages currently installed with new

versions available are retrieved and upgraded; under no

circumstances are currently installed packages removed, or packages

not already installed retrieved and installed. New versions of

currently installed packages that cannot be upgraded without

changing the install status of another package will be left at

their current version. An update must be performed first so that

apt-get knows that new versions of packages are available.

dist-upgrade in addition to performing the function of upgrade,
also intelligently handles changing dependencies with new...

0 0

this is getting tougher as the posts go by

they are 2 completely distros and the upgrade approach


to be totally different as well:

- in lmde (or debian testing or sid) you should always use dist-upgrade: the system changes too much under the hood and you need a tool that provides you the cleaning material to keep it tidy; i don't see option here: you are better off holding updates for some time if you see something fishy in there (and that happens a lot believe me

) than resort to upgrades and mess up the dependencies chain (i vaguely remember issues with libavformat-something that should be removed for the new version be installed and users that were holding this replacement at the time had troubles after)

- in the main edition, it's basically a user's choice together with hardware limitations: explaining >>

do you need the new kernel? are you having hardware issues, drivers issues? do you think that your setup will be better...
0 0

Brief: This beginner’s guide shows you what you can do with apt-get commands in Linux, how to use it to find new packages, install and upgrade new packages and clean your system.

If you have started using Ubuntu or any other Ubuntu based Linux distribution such as Linux Mint, elementary OS etc, you must have come across apt-get command by now.

In fact, first in the list of things to do after installing Ubuntu is to use apt-get update and apt-get upgrade. Now, you might be aware of a few commands and their usage but perhaps you might not be aware of other apt-get commands and their usage.

In this guide for beginners, I am going to explain you various of apt-get commands with examples so that you can use them as an expert Linux user.

What is apt-get?

Ubuntu is derived from Debian Linux. And Debian uses dpkg packaging system. A packaging system is a way to provide programs and applications for installation. This way, you don’t have to build a...

0 0

Dist-upgrade will not go and install every package under the sun.

Well, if you want to do a distro-upgrade, use dist-upgrade. For instance, moving from Debian -stable to Debian -testing. Dist-upgrade is a special upgrade that is used if you are fetching packages from a new location, which is specified in /etc/apt/sources.list

If you want to simply upgrade the packages you have installed for your current distro, use 'apt-get upgrade'.

I hope that clears up your confusion.

1 members found this post helpful.

This depends on how you configured your apt. If apt installs recommends by default, it may be that an newly installed package is only a recommendation and as such not absolutely necessary. If you configured apt to not install recommends (which you should, if you are concerned about the size of the install) then a newly install package will be a dependency. In that case it is absolutely...

0 0

Posted by Steve on Sun 2 Jan 2005 at 14:54

Sometimes when you go to upgrade your machine with apt-get you will see that a package is being "kept back".

Normally to upgrade a machine you would run:

apt-get update apt-get upgrade

This should upgrade all the installed packages upon your machine (well at least all those packages which you have installed that have a newer version available), but it doesn't always do that.

If the dependencies have changed on one of the packages you have installed so that a new package must be installed to perform the upgrade then that will be listed as "kept-back".

For example my apt-get upgrade today showed this:

root@sun:~# apt-get upgrade Building Dependency Tree... Done The following packages have been kept back: bind9-host dnsutils imagemagick libmagick6 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

There we can see four packages haven't been upgraded, even though newer packages are...

0 0

I am trying to write a script that downloads and installs updates using apt-get. The core of my script is:

apt-get update && apt-get upgrade
This command, however, gives a Y/N prompt which would stop the script. I tried giving the upgrade command a /y switch but it did not like it. Anyone have any ideas?

Cut-n-paste this into a file named "update". Set it's permissions as executable (chmod 0755 update) and then copy it to a directory in your path such as "/usr/bin". This one will ask you if you want to install updates.

/usr/bin/apt-get -V update
/usr/bin/apt-get -V dist-upgrade

If you want to run quietly and automatically (like in a cron job), use this instead. Set "email@address" to your own email address of course:

tmpfile=$( /bin/mktemp -t )
/bin/echo return-path: $myname >> $tmpfile
/bin/echo for: $myname >> $tmpfile
/bin/echo from: $myname >> $tmpfile

0 0

> On 10 April 2014 16:07, Frank McCormick

[hidden email]

> wrote:

>> Had a strange problem this morning for the second time recently:



>> root@frank-debian:/home/frank# apt-get upgrade

>> Reading package lists... Done

>> Building dependency tree

>> Reading state information... Done

>> Calculating upgrade... Done

>> The following package was automatically installed and is no longer required:

>> python-gtksourceview2

>> Use 'apt-get autoremove' to remove it.

>> The following packages have been kept back:

>> eom-common mate-panel mate-panel-common

>> The following packages will be upgraded:

>> base-passwd cups cups-bsd cups-client cups-common cups-core-drivers

>> cups-daemon

>> cups-ppdc cups-server-common dnsmasq-base geoip-database libcups2

>> libcupscgi1

>> libcupsimage2 libcupsmime1 libcupsppdc1 man-db pluma pluma-common...

0 0

This article applies to all supported versions of Ubuntu

Package management via apt-get runs hand-in-hand with the /etc/apt/sources.list file. For information on editing or updating your sources list see SourcesList.


This page describes how to handle the packages on your system using apt-get and related commands. For example, you can install a new package, remove an installed package, or update all installed packages to the latest versions.


Installation commands

apt-get install This command installs a new package. apt-get build-dep

This command searches the repositories and installs the build dependencies for . If the package is not in the repositories it will return an error.

aptitude install

Aptitude is an Ncurses viewer of packages installed or available. Aptitude can be used from the command line in a similar way to apt-get. Enter man aptitude for more information.

APT and aptitude...
0 0
0 0

In all the documentation and posts I've read for the RasPi the recommended way to upgrade a distribution and its packages is to use sudo apt-get update followed by sudo apt-get upgrade. But elsewhere it's recommended that you use sudo apt-get


rather than sudo apt-get upgrade. See, for example,

http://askubuntu.com/questions/194651/w ... st-upgrade


"The upgrade option only installs new version of the packages that are already installed on the system (and yes, kernel updates belong to them).

However, sometimes the updates change dependencies: for example, a new version of a package will no longer depend on a library that you have installed, or will require installation of additional libraries. The upgrade option will never remove installed packages that you no longer actually need.

However, the dist-upgrade option can "intelligently" handle changes in the dependencies system. This includes removing packages that are no longer...

0 0

I typically upgrade my machines with:

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

Below is an excerpt from man apt-get. Using upgrade keeps to the rule: under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. If that's important to you, use apt-get upgrade. If you want things to "just work", you probably want apt-get dist-upgrade to ensure dependencies are resolved.

To expand on why you'd want upgrade instead of dist-upgrade, if you are a systems administrator, you need predictability. You might be using advanced features like apt pinning or pulling from a collection of PPAs (perhaps you have an in-house PPA), with various automations in place to inspect your system and available upgrades instead of always eagerly upgrading all available packages. You would get very frustrated when apt performs unscripted behavior, particularly if this leads to downtime of a production service.

upgrade ...
0 0

I was wondering why upgrade sometimes doesn't want to upgrade certain parts of the system, while dist-upgrade does. Here's an example after running update:

apt-get upgrade:

rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages have been kept back: linux-generic linux-headers-generic linux-image-generic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

versus apt-get dist-upgrade:

rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following NEW packages will be installed: linux-headers-3.0.0-13 linux-headers-3.0.0-13-generic linux-image-3.0.0-13-generic The following packages will be upgraded: linux-generic linux-headers-generic linux-image-generic 3 upgraded, 3 newly installed, 0 to remove and 0...
0 0

You can read the man-page of apt-get to see what each command do.

Open the manual

man apt-get

Find the section dist-upgrade and read


in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages

See also: What is “dist-upgrade” and why does it upgrade more than “upgrade”?

In order to upgrade Ubuntu to a newer release you have to run in terminal

sudo do-release-upgrade

We read from the man-page

0 0

If you have customized the package/software at all, either by editing the config files directly, or via a GUI, you may want to keep your customizations. Usually in Unix/Linux systems, configurations are saved in text files, even if the configuration/customization is done via the GUI.

Each Debian binary deb package has a list of files which it identifies as config files. dpkg, and thus apt honor this identification when removing packages, and also on upgrades. By default apt/dpkg will not remove config files on package removal. You have to request a purge. On upgrade it will ask you to choose between the current version and the new version (if they differ) before overwriting config files. Even in that case, it saves a copy of the original file. Here Debian is trying to help you, based on the assumption that your config files may contain valuable information.

So, if you have not configured the package, or you don't want to keep your configurations, you can use apt-get...

0 0
Keep in mind that most of the times instead of apt-get upgrade what you want to do is apt-get dist-upgrade

fdierreJan 9 '12 at 23:41 @TravisR Not really. dist-upgrade won't upgrade to a new OS, but will upgrade to a new kernel (common enough) or a different set of dependencies (common enough) or remove dependencies that don't matter after an upgrade (also common). If you're on a home or office system, most of the time you want dist-upgrade, not upgrade. It's if you are upgrading several systems, or one that you need kept in a well-defined state that you'd want upgrade. For "regular" users (their own machine), dist-upgrade is the one to go for.

Jon HannaApr 25 '14 at 22:08 So do you mean that "apt-get upgrade" will do nothing if not followed by "apt-get update"? If this is so, what is the real use of "apt-get update"? Then why the "update" is not included in "upgrade"?


0 0

If any single program defines the Debian Linux project, that program is apt-get. apt-get is Debian's main tool for installing and removing software. Working with the .deb package format, apt-get offers sophisticated package management that few Red Hat Package Manager RPM-based distributions can match.

Besides the convenience, an advantage of apt-get is that it reduces the chances of falling into dependency hell, that limbo where software installation fails for lack of another piece of software, whose installation fails for lack of another piece of software, and so on. If you know how Debian's archive system works, and how to choose the sources that apt-get uses, and use a few precautions in your upgrades, then the chances are that dependency problems will never bedevil you. Should you descend into dependency hell anyway, apt-get offers useful tools for climbing out of it.

Knowing the Debian archives

Most of the time, apt-get works with the Debian online...

0 0

In my case packages held back were those related to linux-headers and kernel. I came to this by trying to solve an issue with having a red exclamation mark in the notification area and not being able to update packages.

To solve it, I did not have to use neither dist-upgrade nor manual apt-get install xxx.

What I did and has helped has been simple and clean:

sudo apt-get update sudo apt-get autoremove sudo apt-get autoclean sudo apt-get upgrade

I had to manually confirm Grub update and its configuration.

Then I just worked with the computer for a while and then standard update dialogue has appeared again finally including "Ubuntu base" section with kernel and related. The update was performed without any trouble and I do not see any held back packages any more.

Also, it is very important to keep in mind that those *buntu updates including kernel updates are sensitive to hibernation - I've got this problem several times and I always get it resolved...

0 0

Ubuntu has a lot of GUI-based methods for installing applications, but they take some time to search and find. Since the keyboard is usually faster than the mouse, managing your software via the command-line can be a real time-saver.


Linux manages software through packages, individual units of software that contain user interfaces, modules, and libraries. Most applications link several co-dependent packages together, and still others allow you to choose which packages to install and which to leave out at your own discretion. This can get confusing, so there’s a package manager at your disposal to help

Each Linux distribution has its own package management system. For our own near and dear Ubuntu, it’s the Advanced Packaging Tool. It has a family of commands that allows you to add repositories; search for, install, and remove packages; and even simulate upgrades and such. The commands are fairly easy to remember and use, so you’ll be managing your...

0 0

Just an addition for users that could land here looking for the upgrade procedure, like me!

On the official Raspberry Pi website the update from Wheezy to Jessie is discouraged. Instead they recommend to make a clean Jessie install.

From https://www.raspberrypi.org/blog/raspbian-jessie-is-here/:

Starting with a clean image is the recommended way to move to Jessie. If you really need to update a Wheezy image, we have tried an unsupported upgrade path which is documented on the forums here. This has been shown to work on a vanilla Wheezy image, but we can’t predict what effect it may have on any packages or data that you have installed, so this is very much at your own risk.

And for those who are brave, this is the forum post where all the passages for the update are...

0 0

APT is a vast project, whose original plans included a graphical interface. It is based on a library which contains the core application, and apt-get is the first front end — command-line based — which was developed within the project. apt is a second command-line based front end provided by APT which overcomes some design mistakes of apt-get.

Numerous other graphical interfaces then appeared as external projects: synaptic, aptitude (which includes both a text mode interface and a graphical one — even if not complete yet), wajig, etc. The most recommended interface, apt, is the one that we will use in the examples given in this section. Note however that apt-get and aptitude have a very similar command line syntax. When there are major differences between apt, apt-get and aptitude, these differences will be detailed.

For any work with APT, the list of available packages needs to be updated; this can be done simply through apt update. Depending on the speed of...

0 0