0

A few times, when running sudo apt-get upgrade, I've run into the message "The following packages have been kept back:", followed by a list of packages that would not be upgraded. Searching the message online shows that most people solve this by using sudo apt-get dist-upgrade. However, it is sometimes stated that this is a dangerous command, that "it could leave you with a very broken system". Therefore I've always solved this by performing sudo apt-get --with-new-pkgs upgrade instead. Always... until now. Now I've run into a situation where the first command worked, while the second refused to (i.e., it led to the same "packages have been kept back" problem).

What could be the cause of this? I know that dist-upgrade is allowed to remove packages, instead of only being able to install new ones (as the --with-new-pkgs flag does). But why would an upgrade need to remove any of my packages?

LGenzelis
  • 190

1 Answers1

2

The answer to your question is buried in the comments of the posting you linked to: Sometimes a package is upgraded or changed and this package cannot coexist on the system with a prior version, or with some other package on your computer. " Think of llvm3.6 vs. llvm3.6v5 (with the "v5" meaning that it was compiled with gcc 5). These two cannot co-exist, only either of both can be kept on the system."

As I'm a relative novice, I cannot talk to the veracity of this particular situation but I can state that I used to use dist-upgrade quite often, and never entered a situation which broke my system. I also run the most current released version of Ubuntu, and occasionally need to reinstall my system anyhow.

The current flavor of upgrades prefers the apt command set as opposed to apt-get. There is some information at What is the difference between apt and apt-get?

Charles Green
  • 21,339
  • Why do you occasionally need to reinstall your system? I've never needed that. I only reinstall my system every two years, when a new LTS version of Ubuntu comes out. – LGenzelis Aug 20 '17 at 04:01
  • @LGenzelis I'm running the interim releases - currently 17.04 and soon 17.10, and I mess with my system all the time. Can't help myself. Sooner or later I bugger stuff up, and I found (on earlier releases) that sometimes the upgrades do not go as well as I would like. – Charles Green Aug 20 '17 at 04:19