The error message “the following packages have been kept back” has occurred when implementing the package management tools like “apt” and “apt-get” in your Linux/Ubuntu operating system. This message gives the instruction to upgrade the mentioned packages. 

This article explains all the reasons why this error message appears in the terminal. There are four main reasons this error message may occur.

  • Packages dependencies
  • Same packages
  • Update the critical packages
  • Preferences on packages

Reason 1: Packages Dependencies

While upgrading the packages there are some packages that need to be updated before upgrading them. This shows the dependencies of these packages on update to the latest version before upgrading them. Therefore the package manager sent the error message to “keep back” these packages in remaining condition.   

Reason 2: Same Packages

If two packages perform the same function the package manager outputs the error message and keeps back the packages without upgrading them. This issue may occur due to third party repositories.

Reason 3: Update the critical packages

Sometime restriction has been applied on the specific packages such as system related packages to remain there version to avoid the instability of your operating system. This is the reason the package manager sent the error message. 

Reason 4: Preferences on Packages

Sometimes users set the preference to upgrade the specific number of packages due to this, some packages do not upgrade and the package manager sends the error message “the following packages have been kept back”.

How to Fix “The Following Packages Have Been Kept Back:” Error

To resolve the issue of the message “the following packages have been kept back” in the Linux/Ubuntu operating system first we know why this error message will occur. The error message is generated when you run the mentioned command. 

sudo apt upgrade

After running the above-given command in the terminal it is identified the “gjs”, irqbalance” and  libgjs0g” are three packages to upgrade alone to avoid this message. 

Now install the package  “irqbalance” by executing the below-given command in the Linux/Ubuntu terminal to avoid the error message “the following packages have been kept back”.

sudo apt install irqbalance

Now install the package  “gjs” by executing the below-given command in the Linux/Ubuntu terminal.

sudo apt install gjs

Now install the package  “ libgjs0g” by executing the below-given command in the Linux/Ubuntu terminal.

sudo apt install libgjs0g

Now all three required packages are installed, again run the upgrade command to show that the problem is resolved.

sudo apt upgrade

The above diagram depicts that no error message appears after installing the latest version of all three required packages; this shows that your problem is resolved now.

Conclusion

To resolve the error message “the following packages have been kept back” in the Linux/Ubuntu terminal you need to install or upgrade to the latest version of the mentioned packages. In our case, there are three packages  “gjs”, irqbalance” and  libgjs0g” which are required to be an upgrade. After installing the latest version of these packages the error message no longer appears.