How to Fix Held Packages Issue in Ubuntu

Held packages in Ubuntu

Have you ever tried to update Ubuntu from the terminal and found that there was software that could not be updated? Well, that "you can't" in Linux is relative, because you can do almost anything. It cannot be done in the usual way or at a specific time, but the held packets by Ubuntu can be installed. Whether it is worth doing at the moment or what this means is something that we are going to explain here and now.

The scenario is this: we open a terminal, we write sudo apt update && sudo apt upgrade, tells us that there are packages to update and some that have been withheld. in the same terminal let's see what they are the packages that are not going to be installed, and if we do not know what is happening and if it is normal, what is going to be normal is that we have the fly behind our ear.

Why do we see the Held Packages notice in Ubuntu

Actually, although it may give some courage, it is nothing abnormal, not even a bad thing. What is happening is that when you run the "apt upgrade" command, the system upgrades all packages to their latest version, but not always. If the dependencies of a package have changed in a way that requires the installation of new packages, the package will not be updated alongside the system and we will see this warning, which It is not an error really.

The warning informs us that it is likely that a package that we already had installed now has dependencies that we do not have installed. So what is it we should do? We can choose between:

  • The recommended thing, or at least what I would recommend, would be to leave the message for some time, so that if there are any packages that are not compatible with the update, we give the developers time.
  • The other option is to manually copy the list of retained packages (remember to press the Shift key next to Ctrl if you want to use the keyboard shortcut) and install it with sudo apt install -package list-. In theory, this will install the package and we will stop seeing the error, and if the problem was because of new dependencies, it should install them.

The terminal gives us more information

Explanation after installing packages

After doing the manual installation, if there is information that we need to know, APT will tell us in the same terminal. For example, install the package tzdata, which was initially held, the terminal tells me that the current time zone is Europe/Madrid, and what should I do if it doesn't seem right.

There are more options, like using dist-upgrade, but they can be too aggressive and remove packages we might need. The first thing, patience, since it is already known that he had a daughter whom he called Science. If the notice does not go away, the manual installation should be the solution.