Linux image generic kept back

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.

Читайте также:  Linux какие разделы есть

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.

Источник

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

Источник

Читайте также:  Linux vs windows mem

Thread: Updates — Not upgraded — Kept Back (Linux-Generic)

Alan5127 is offlineGee! These Aren’t Roasted!

Updates — Not upgraded — Kept Back (Linux-Generic)

I have a machine (Ubuntu 16.04.2 LTS) that has just given me the ‘not upgraded / kept back’ response to ‘sudo apt-get upgrade’.

The three items ‘not upgraded / kept back’ are:

In the past, if I have had this with some program, I have usually done this:

However, given that these three are not just programs, but are more fundamental / low level, I thought it best to ask here how best to resolve this.

For the avoidance of doubt, all other items have upgraded fine, and there is nothing showing to remove.

This is the actual output from 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 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

Thank you for any assistance you can provide,

deadflowr is offlineRobot Pirate Ghost

Re: Updates — Not upgraded — Kept Back (Linux-Generic)

The packages are held back because they require the installation of new packages and sudo apt-get upgrade does not install new packages.
To install the required new packages you can run

To note this only updates the current release and does not upgrade that to another, newer, release
(like upgrading from 14.04 to 16.04, it will not do that)

Basically apt-get upgrade only updates packages that exist on the system. But will never install new packages.
apt-get dist-upgrade will install new packages if the updates require them.

Splat Double Splat Triple Splat
Earn Your Keep
Don’t mind me, I’m only passing through.
Once in a blue moon, I’m actually helpful .

Alan5127 is offlineGee! These Aren’t Roasted!

Re: Updates — Not upgraded — Kept Back (Linux-Generic)

QuoteOriginally Posted by deadflowr View Post

The packages are held back because they require the installation of new packages and sudo apt-get upgrade does not install new packages.
To install the required new packages you can run

To note this only updates the current release and does not upgrade that to another, newer, release
(like upgrading from 14.04 to 16.04, it will not do that)

Читайте также:  Linux send arp request

Basically apt-get upgrade only updates packages that exist on the system. But will never install new packages.
apt-get dist-upgrade will install new packages if the updates require them.

I had been considering changing my ‘script’ (string of commands) that I run periodically to change from ‘upgrade’ to ‘dist-upgrade’ anyway, so perhaps this confirms that I should.

I currently run the following:

sudo apt-get clean && cd /var/lib/apt && sudo mv lists lists.old_`date '+%Y%m%d_%H%M'` && sudo mkdir -p lists/partial && sudo apt-get clean && sudo apt-get update && sudo apt-get upgrade

which I got from somewhere (maybe here!) a very long time ago, and at the time, I suspect I had little idea what it was really doing (not that I am any expert now), and I have just never really thought about it until recently (last few months).

So, is there any (significant) downside to me changing that to dist-upgrade as follows?

sudo apt-get clean && cd /var/lib/apt && sudo mv lists lists.old_`date '+%Y%m%d_%H%M'` && sudo mkdir -p lists/partial && sudo apt-get clean && sudo apt-get update && sudo apt-get dist-upgrade

deadflowr is offlineRobot Pirate Ghost

Re: Updates — Not upgraded — Kept Back (Linux-Generic)

One downsize might be that the way dist-upgrade works is that if a new packages require an older version to be uninstalled it will uninstall that older version.
I have never seen this to be a problem, myself.

I had been considering changing my ‘script’ (string of commands) that I run periodically to change from ‘upgrade’ to ‘dist-upgrade’ anyway, so perhaps this confirms that I should.

Two things stand out in the command:
1) you should only need to run the sudo apt-get clean command once.
(running it twice it like taking the trash out, then walking back into your home and then walking back out to empty the empty trash can)

2)mv-ing or rm-ing the /var/lib/apt/lists folder should really only be done as a nuclear option.
usually you only need to run that when there is some sort of error from sudo apt-get update that produces a reference to that folder, typically a mismatch hashsum error.
Otherwise it’s overkill.

(And it also extends the amount of time it takes to generate the output for sudo apt-get update, since it has to re download everything from scratch.
Normally, apt reads the hashes from the lists folder files and sees what matches to the hashes from the server, and then updates those which do not match.
So at times some archives do not change a lot, which makes it faster as apt will simply ignore those that it already sees as up-to-date)

Splat Double Splat Triple Splat
Earn Your Keep
Don’t mind me, I’m only passing through.
Once in a blue moon, I’m actually helpful .

Источник

Оцените статью
Adblock
detector