Score:1

Is it possible to configure apt so that the output of apt update does not list kept back packages?

jp flag

This question concerns the infamous "The following packages have been kept back" message, however, I'm not asking how to (1) disable phased updates (I'd rather stick to the "standard" update cycle); or (2) manually install the kept back packages (I know that this is a bad practice). Rather, what I'm looking for is a way to configure apt so that the "summary message" returned when running apt update simply disregards the kept back packages (in particular, those kept back due to phased updates).

For example, just now, when running sudo apt update, I'm getting the following "bottom line" message:

2 packages can be upgraded. Run 'apt list --upgradable' to see them.

Following that, I'm running sudo apt full-upgrade just to discover that the two "upgradable" packages are actually kept back and the upgrade attempt is redundant:

The following packages have been kept back:
  libruby3.0 ruby3.0
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

Therefore, what I'm looking for is a way to configure apt so that the the aforementioned "bottom line" message of apt update would have "ignored" the kept back packages and report instead that there is nothing to upgrade (at the moment).

Any ideas? For the record, I'm running Ubuntu 22.04 although I guess that the question may be relevant to other Ubuntu releases as well.

Clarification: What I'm asking for is already implemented in the GUI Software Updater tool (also in Synaptic), where the "status report" regarding the upgradable packages does not take the kept back packages into account.

Score:1
cn flag

It seems to me that the only workaround is to ignore the output (i.e. the last line) of:

# apt update
[...]
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

and instead use the output of:

# apt-get --dry-run  upgrade | grep 'upgraded\.$'
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Yuvalem avatar
jp flag
Thanks, I wasn't aware of the `dry-run` option
Score:0
mx flag

Keep in mind, that apt repositories do not change immediately. When new package is uploaded to the repository, it is needed the time to upload it's dependencies. In this time, package cannot be installed/upgraded.

You can't configure this behaviour.

Yuvalem avatar
jp flag
I think that there may have been some misunderstanding with my question, please see the clarification I added.
Score:0
cn flag

No it is not.You can not do what you asked.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.