hippy
Posts: 5757
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

apt-get upgrade - packages kept back

Mon Apr 25, 2016 5:08 pm

I have just done my regular "sudo apt-get update", "sudo apt-get upgrade" and got a "kept back" result with upgrade. Is it anything to worry about ???

Code: Select all

[email protected]:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  pypy-upstream raspberrypi-ui-mods
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. 

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: apt-get upgrade - packages kept back

Mon Apr 25, 2016 5:32 pm

If dependencies have changed and something old must be removed, and something new installed, then "upgrade" will hold the package back, it won't install/remove anything, only upgrade existing.

You can use "sudo apt-get dist-upgrade" to bring everything up to date, but "dist-upgrade" may make changes that you don't want. I prefer to just "re-install" the held back packages when they occur, rather than do a complete "dist-upgrade".

Code: Select all

sudo apt-get install --reinstall pypy-upstream raspberrypi-ui-mods
That will upgrade the two packages and keep any existing config files intact. A following "apt-get upgrade" afterward shouldn't show any packages being held back.

hippy
Posts: 5757
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: apt-get upgrade - packages kept back

Mon Apr 25, 2016 6:58 pm

Many thanks, for the explanation and the --reinstall flag I wasn't familiar with. That seems to have fixed things.

pxgator
Posts: 105
Joined: Mon Feb 16, 2015 6:45 pm
Location: Southern Colorado, USA

Re: apt-get upgrade - packages kept back

Wed Apr 27, 2016 3:46 pm

So at some point in time will a regular update/upgrade sequence
install these two packages and autoremove what is not needed?
So what's all this RPi stuff anyhow? Well folks, it's a feat of engineering from
the UK almost as remarkable as the De Havilland Mosquito and the Colossus.

hippy
Posts: 5757
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: apt-get upgrade - packages kept back

Thu May 19, 2016 11:42 am

Today I got more of these with a sudo apt-get upgrade ...

Code: Select all

The following packages have been kept back:
  libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0
  lxpanel lxpanel-data raspberrypi-bootloader
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Do I need to reinstall these all manually as before ?

I am starting to worry that things are out of kilter, getting increasingly more so, and I will eventually be forced to reinstall from scratch again.

I am not sure how things are so out of kilter as I have only ever used apt-get update and upgrade, have never used dist-upgrade or other more dangerous options.

User avatar
rpdom
Posts: 14976
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: apt-get upgrade - packages kept back

Thu May 19, 2016 11:50 am

Those packages have been held back from the upgrade because they will cause some new extra packages to be installed and apt-get upgrade won't allow that.

To upgrade those packages and install the new ones you need to run "sudo apt-get dist-upgrade", which will upgrade and install them.

hippy
Posts: 5757
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: apt-get upgrade - packages kept back

Thu May 19, 2016 12:04 pm

rpdom wrote:To upgrade those packages and install the new ones you need to run "sudo apt-get dist-upgrade", which will upgrade and install them.
But what about the frequent advice that dist-upgrade should not be run, the frequent warnings that it can break things, may change things I have previously set up ?

Do I need to install the packages kept back ? Am I better off having them or not having them ?

If I just ignore the issue, ignore the kept backs, am I simply digging myself into future problems ? It seems I am between a rock and a hard place.

Is there any way to find out how and why I've got into a situation where things are being kept back ? I have regularly updated / upgraded so I am not sure why or how I ended up in this position.

User avatar
rpdom
Posts: 14976
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: apt-get upgrade - packages kept back

Thu May 19, 2016 12:12 pm

hippy wrote:
rpdom wrote:To upgrade those packages and install the new ones you need to run "sudo apt-get dist-upgrade", which will upgrade and install them.
But what about the frequent advice that dist-upgrade should not be run, the frequent warnings that it can break things, may change things I have previously set up ?

Do I need to install the packages kept back ? Am I better off having them or not having them ?

If I just ignore the issue, ignore the kept backs, am I simply digging myself into future problems ? It seems I am between a rock and a hard place.

Is there any way to find out how and why I've got into a situation where things are being kept back ? I have regularly updated / upgraded so I am not sure why or how I ended up in this position.
If you run the dist-upgrade command it will tell you which packages will be installed, before asking for confirmation that you wish to continue.

I don't know where you heard that "frequent advice", but it is wrong.

If you ignore the upgrades you will end up stuck with an old kernel, among other things.

One of the changes is that the old raspberrypi-bootloader package contained the bootloader and also the linux kernel. The kernel has now been split off into a new package, raspberrypi-kernel, which will be one of the ones that are causing your upgrade to be held back.

hippy
Posts: 5757
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: apt-get upgrade - packages kept back

Thu May 19, 2016 1:05 pm

rpdom wrote:I don't know where you heard that "frequent advice", but it is wrong.
Perhaps I was thinking of rpi-update or something else. Anyway, dived in and did 'dist-upgrade' -

A couple of errors relating to bluez and pulseaudio-module-bluetooth not being configured, which seem to have sorted themselves after a subsequent 'upgrade'. So it does seem to have worked.

tweak42
Posts: 498
Joined: Tue Mar 22, 2016 3:16 am
Location: Los Angeles, California

Re: apt-get upgrade - packages kept back

Fri May 20, 2016 1:07 am

hippy wrote:
rpdom wrote:To upgrade those packages and install the new ones you need to run "sudo apt-get dist-upgrade", which will upgrade and install them.
But what about the frequent advice that dist-upgrade should not be run, the frequent warnings that it can break things, may change things I have previously set up ?

Do I need to install the packages kept back ? Am I better off having them or not having them ?

If I just ignore the issue, ignore the kept backs, am I simply digging myself into future problems ? It seems I am between a rock and a hard place.

Is there any way to find out how and why I've got into a situation where things are being kept back ? I have regularly updated / upgraded so I am not sure why or how I ended up in this position.
The dist-upgrade is meant more as a warning for customize systems that are locked into a production environment (aka businesses) so that they don't end up upgrading a package that breaks some part of their custom software or hardware causing downtime.

Example: You spend a inordinate amount of time configuring a oddball usb wifi adapter - eventually getting it working with some hacks. Then a few months later the settings are reset/wiped in a dist-upgrade. Not a very likely scenario, and you could undo it, but still the risk of downtime is there.

In summary, keep updated - there's always new improvements and features on horizon, just beware of the possibility of breakage so backup your stuff if it's that important to your sanity and time.

Return to “General discussion”