Monday, January 23, 2023

"The following packages have been kept back" Error

You're getting the error "The following packages have been kept back: <list of packages>" after you run the sudo apt-get update && apt-get upgrade commands.


Here are three solutions to getting the "kept back" packages upgraded.  Open a Terminal Window and try one of the following three solutions

1. This may install the "kept back" packages with little risk.

sudo apt-get --with-new-pkgs upgrade


2. This will install each of the "kept back" packages specifically.  Replace <list of packages kept back> with the exact names of the packages listed as "kept back" (this solution usually works for me). 

sudo apt-get install <list of packages kept back>


3.  If the first two solutions didn't work you can try dist-upgradedist-upgrade can be dangerous as it forces the installation of the new dependencies. It may remove packages to resolve complex dependency issues. Use this at your own risk. 

apt-get dist-upgrade 


That's it.  Hope this helps.  I've ran into this problem a few times and solution number two usually works for me.  Once I used solution three without issue.  When using solution two you can copy and paste the list of kept back packages from the Terminal Window.