15

I have a package being kept back whilst trying to upgrade:

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  mesa-opencl-icd:i386
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

After I run apt list --upgradable I see:

"There are 2 additional versions. Please use the '-a' switch to see them."

So I run apt list --upgradable -a and I see:

Listing... Done
mesa-opencl-icd/focal-updates,focal-security 21.2.6-0ubuntu0.1~20.04.2 i386 [upgradable from: 21.0.3-0ubuntu0.3~20.04.5]
mesa-opencl-icd/now 21.0.3-0ubuntu0.3~20.04.5 i386 [installed,upgradable to: 21.2.6-0ubuntu0.1~20.04.2]
mesa-opencl-icd/focal 20.0.4-2ubuntu1 i386

After searching I see various methods of attempting to fix this, but they involve sudo apt-get dist-upgrade and I believe that can cause problems. Also sudo apt-get install <list of packages kept back> but I dont want to forcefully install something that my system is preventing me from installing.

I'd prefer to find out why this is happening and fix the problem with dependencies or conflicts.

I'm on Xubuntu 20.04.4 LTS

Could someone advise on how to best fix this particular problem?

Edit, no luck after sudo apt dist-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:
  libclang-common-12-dev
Use 'sudo apt autoremove' to remove it.
The following packages have been kept back:
  mesa-opencl-icd:i386
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

$ sudo apt autoremove Reading package lists... Done Building dependency tree
Reading state information... Done The following packages will be REMOVED libclang-common-12-dev 0 to upgrade, 0 to newly install, 1 to remove and 1 not to upgrade. After this operation, 65.6 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 301137 files and directories currently installed.) Removing libclang-common-12-dev (1:12.0.0-3ubuntu1~20.04.5) ...

$ sudo apt update Hit:1 http://archive.canonical.com/ubuntu focal InRelease Reading package lists... Done Building dependency tree
Reading state information... Done 2 packages can be upgraded. Run 'apt list --upgradable' to see them.

$ apt list --upgradable Listing... Done mesa-opencl-icd/focal-updates,focal-security 21.2.6-0ubuntu0.1~20.04.2 i386 [upgradable from: 21.0.3-0ubuntu0.3~20.04.5] rsync/focal-updates,focal-security 3.1.3-8ubuntu0.3 amd64 [upgradable from: 3.1.3-8ubuntu0.2]

$ sudo apt upgrade Reading package lists... Done Building dependency tree
Reading state information... Done Calculating upgrade... Done The following packages have been kept back: mesa-opencl-icd:i386 The following packages will be upgraded: rsync 1 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade. 1 standard security update Need to get 318 kB of archives. After this operation, 4,096 B of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 rsync amd64 3.1.3-8ubuntu0.3 [318 kB] Fetched 318 kB in 0s (2,728 kB/s) (Reading database ... 300703 files and directories currently installed.) Preparing to unpack .../rsync_3.1.3-8ubuntu0.3_amd64.deb ... Unpacking rsync (3.1.3-8ubuntu0.3) over (3.1.3-8ubuntu0.2) ... Setting up rsync (3.1.3-8ubuntu0.3) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for systemd (245.4-4ubuntu3.15) ...

$ sudo apt update Hit:1 http://ppa.launchpad.net/libretro/stable/ubuntu focal InRelease Reading package lists... Done Building dependency tree
Reading state information... Done 1 package can be upgraded. Run 'apt list --upgradable' to see it.

$ sudo apt upgrade Reading package lists... Done Building dependency tree
Reading state information... Done Calculating upgrade... Done The following packages have been kept back: mesa-opencl-icd:i386 0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

$ sudo apt dist-upgrade Reading package lists... Done Building dependency tree
Reading state information... Done Calculating upgrade... Done The following packages have been kept back: mesa-opencl-icd:i386 0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

3 Answers3

22

This solved the problem for me:

sudo apt-get install aptitude 
sudo aptitude safe-upgrade
Zanna
  • 72,312
Atif
  • 594
22

On my system, I had multiple kept-back packages as well. In my case, the packages were not updated (sudo apt-get dist-upgrade) since the updates were phased updates.

Phased updates are a safety feature: They are not introduced to all users at the same time; only some users receive them at the beginning to report potential issues (see this answer for more information).

You can check if your kept-back PackageA contains a phased update by running apt-cache policy PackageA. Phased updates are indicated in the "Version table" by a phased percentage.

Niklas
  • 467
1

You may try to use your existing tools already installed. For me worked:

sudo apt full-upgrade