- How To: Upgrade Packages that Were Kept Back
- How apt-get Keeps Packages Back
- Why Packages Are Kept Back by apt-get
- How To Upgrade Packages That Were Kept Back
- See Also
- Ubuntu 16.04 — kernel packages have been kept back
- 3 Answers 3
- Thread: The following packages have been kept back: linux-generic-lts-utopic linux.
- The following packages have been kept back: linux-generic-lts-utopic linux.
- Re: The following packages have been kept back: linux-generic-lts-utopic linux.
- Re: The following packages have been kept back: linux-generic-lts-utopic linux.
- Re: The following packages have been kept back: linux-generic-lts-utopic linux.
- Re: The following packages have been kept back: linux-generic-lts-utopic linux.
- Re: The following packages have been kept back: linux-generic-lts-utopic linux.
How To: Upgrade Packages that Were Kept Back
Now and then you may notice that apt-get upgrade command keeps a few packages back, meaning they don’t get upgraded. This quick post shows what you can do about it and how to get all the packages upgraded.
How apt-get Keeps Packages Back
[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: linux-generic linux-headers-generic linux-image-generic 0 to upgrade, 0 to newly install, 0 to remove and 3 not to upgrade.
Why Packages Are Kept Back by apt-get
Most likely reason for keeping packages back is that upgrading them means installing new packages or removing existing ones. apt-get upgrade strictly upgrades existing packages, without removing or installing anything. Since the command you’re giving to apt-get is upgrade and not to install new packages, packages that require some old packages removed or new packages installed are kept back.
How To Upgrade Packages That Were Kept Back
Simply use the dist-upgrade option of apt-get, which will resolve dependencies and install/remove dependent package as needed:
[email protected]:~ $ 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-5.0.0-20 linux-headers-5.0.0-20-generic linux-image-5.0.0-20-generic linux-modules-5.0.0-20-generic linux-modules-extra-5.0.0-20-generic The following packages will be upgraded: linux-generic linux-headers-generic linux-image-generic 3 to upgrade, 5 to newly install, 0 to remove and 0 not to upgrade. Need to get 67.0 MB of archives. After this operation, 334 MB of additional disk space will be used. Do you want to continue? [Y/n] y
See Also
Ubuntu 16.04 — kernel packages have been kept back
I’m afraid that if I run sudo apt-get dist-upgrade something could go wrong and could mess up my Ubuntu installation. I have seen similar questions here but I think they are different from my problem. What should I do ?
Apt never performs operations beyond those explicitly requested without user feedback; just answer the question with n for «no» (or the equivalent of the language that Apt uses). If you’re still unsure about what might happen during an Apt operation you can use the command-line options -s / —simulate / —just-print / —dry-run / —recon / —no-act to see what Apt would do without actually doing it.
3 Answers 3
If the upgrade of an existing package would require a «new» package (e.g. not-yet-installed) to be installed, then that particular existing package will be «kept back.»
According to the man apt-get, upgrade by default does not install other not-yet-installed packages:
upgrade
. under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed.
—with-new-pkgs
Allow installing new packages when used in conjunction with upgrade. This is useful if the update of a installed package requires new dependencies to be installed. Instead of holding the package back upgrade will upgrade the package and install the new dependencies. .
so, —with-new-pkgs needs to be added to allow inclusion of the related other packages.
sudo apt-get --with-new-pkgs upgrade
—with-new-pkgs allows the related «not-yet-installed» packages to be installed with a Y/n interactive prompt.
Also, as an added benefit, sudo apt-get —with-new-pkgs upgrade does NOT have side affect of causing packages to be marked as manually installed.
Ubuntu 18.04 provides a newer, streamlined syntax of apt which can be used instead of apt-get .
sudo apt upgrade --with-new-pkgs
The whole «if a package requires a new package to be installed» then it will be kept back doesn’t make sense to me. I have my own deb package I manage, and if I add a dependency that isn’t installed on my system apt upgrade will still upgrade the package and not keep it back.
@shreddish In my experience, some sudo apt-get upgrade scenarios have needed the —with-new-pkgs per the man page information. Apparently, the deb package you manage, or the test scenario being used, does not trigger the need for the —with-new-pkgs option with an added uninstalled dependency . for some yet to be discovered reason. It would be interesting to know if you were able to isolate the reason why.
Although the general topic «packages have been kept back» has been answered here before : There is something strange going on today . when I executed sudo apt update a few hours ago, the new kernel 4.8.0-42 was offered for installation. I executed sudo apt dist-upgrade and after the restart of the system (Ubuntu 16.10 workstation), I was running that new kernel.
A few hours later I wanted to upgrade my Ubuntu server installation, but a new kernel was not offered. To re-check the situation I restored my clonezilla system backup image from yesterday on the Ubuntu workstation to re-check the situation. This time the new kernel was not offered anymore. It seems that kernel 4.8.0-42 was accidentally pushed to the main repository and is on the way to getting pushed back to the proposed repository — maybe Canonical has found a bug.
You have opted in to the HWE stack of Ubuntu 16.04, which means that you are using the kernel 4.8 of Ubuntu 16.10. Hence everything happens with the kernel in Ubuntu 16.10 first, a possible explanation for the time delay of the refreshing process for the Ubuntu 16.04 LTS repositories.
When you run sudo apt update a little bit later again, the message you got should not appear anymore. Conclusion : Do not run sudo apt dist-upgrade and wait right until the repositories got updated and the message about the held back kernel packages does not appear any longer. By the way, exactly the same happened with the kernel version 4.8.0-40 already some time ago.
Thread: The following packages have been kept back: linux-generic-lts-utopic linux.
First Cup of Ubuntu
The following packages have been kept back: linux-generic-lts-utopic linux.
Not sure if there’s a better place to post this, but I have a question about updating. While doing the normal ‘sudo apt-get upgrade && sudo apt-get install’ I get the message that:
«The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic»
I understand that this would normally just require an ‘apt-get dist-upgrade’ , but I am content with keeping my 14.04 LTS setup just as it is. Am I to just continue ignoring this message, or will it eventually install and upgrade me to Utopic once the dependencies or whatever have been met? I’m just not sure what to do and I hope I have phrased my question properly.
Ubuntu Member
Join Date Jul 2010 Location ozarks, Arkansas, USA Beans 14,049 —> Beans 14,049 Distro Xubuntu 22.04 Jammy Jellyfish
Re: The following packages have been kept back: linux-generic-lts-utopic linux.
I do suggest that you follow your intuition and:
sudo apt-get update sudo apt-get dist-upgrade
this will install the current system updates and will not release upgrade to ‘utopic’ .. just the kernel and xorg will be on ‘utopic’s’ stack.
First Cup of Ubuntu
Re: The following packages have been kept back: linux-generic-lts-utopic linux.
Good call, Bashing-om. Thank you for your insight and a quick reply. Based on the information provided in the link, it does seem that because I just recently did a fresh install from 14.04.2 live cd that I have this feature enabled. So I’m to understand that this just allows my current LTS to update to the newest kernel without «changing» it to 14.10 Utopic. Do you forsee any trouble in having a newer kernel with the older Trusty packages?
Dark-Roasted but Half-Baked
Re: The following packages have been kept back: linux-generic-lts-utopic linux.
Hello! Do you use AMD graphics and, if so, do you use the proprietary driver?
If you do, there is currently a bug that will spoil the update to the new graphics stack.
A thing discovered and kept to oneself must be discovered time and again by others. A thing discovered and shared with others need be discovered only the once.
This universe is crazy. I’m going back to my own.
First Cup of Ubuntu
Re: The following packages have been kept back: linux-generic-lts-utopic linux.
Thanks for the heads up, QIII. I am using an NVIDIA GTX750ti so I hope that there won’t be any issues. I’m using the recommended NVIDIA drivers and haven’t had a problem so far.
Ubuntu Member
Join Date Jul 2010 Location ozarks, Arkansas, USA Beans 14,049 —> Beans 14,049 Distro Xubuntu 22.04 Jammy Jellyfish
Re: The following packages have been kept back: linux-generic-lts-utopic linux.
No way top call that one. As the purpose of HWE is to support new hardware. I can not say what the result will be, as what you had may have been stable on the standard install. Just depends on your hardware and how it all interacts.
Wont hurt a thing to see what happens and worse case situation -> (RE-)install with release 14.04.1 and NOT opt in for HWE.