#1127453 apt: inconsistency between "apt upgrade -s" and "apt-get upgrade -s" for empty square brackets

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Vincent Lefevre
Date:
2026-02-10 16:03:01 UTC
Severity:
normal
#1127453#5
Date:
2026-02-09 01:56:12 UTC
From:
To:
I get the following:

qaa:~> apt upgrade -s | grep '^Inst libbs2b0'

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Inst libbs2b0 [3.1.0+dfsg-8+b1] (3.1.0+dfsg-8+b2 Debian:testing, Debian:unstable [amd64]) []
qaa:~> apt-get upgrade -s | grep '^Inst libbs2b0'
Inst libbs2b0 [3.1.0+dfsg-8+b1] (3.1.0+dfsg-8+b2 Debian:testing, Debian:unstable [amd64])

For the first one, I get empty square brackets, but not for the
second one.

With "apt install -s libbs2b0" and "apt-get install -s libbs2b0",
there are no empty square brackets.

Moreover, the apt-get(8) man page says for -s (--simulate):

  Square brackets indicate broken packages, and empty square brackets
  indicate breaks that are of no consequence (rare).

but actually, this is quite common:

qaa:~> apt upgrade -s | grep -c '^Inst .* \[\]$'

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

145
qaa:~> apt-get upgrade -s | grep -c '^Inst .* \[\]$'
131

#1127453#10
Date:
2026-02-10 08:46:58 UTC
From:
To:
I'd be happy to consider looking at any concrete bugs you encounter;
but comparing two different commands* and saying they behave differently
isn't very helpful.

* apt upgrade is roughly apt-get upgrade --with-new-pkgs;
  apt-get upgrade is roughly apt upgrade --without-new-pkgs;
  but of course there are more differences, and the interface
  is versioned now; see apt-config dump | grep ^Version for all
  features enabled in 1.0 and newer (apt-get is the 0.x compat mode)

#1127453#15
Date:
2026-02-10 16:00:03 UTC
From:
To:
disset:~> apt-get install -s openssh-client openssh-server openssh-sftp-server
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Solving dependencies... Done
The following packages will be upgraded:
  openssh-client openssh-server openssh-sftp-server
3 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
Inst openssh-sftp-server [1:10.0p1-8] (1:10.2p1-3 Debian:testing, Debian:unstable [amd64]) []
Inst openssh-server [1:10.0p1-8] (1:10.2p1-3 Debian:testing, Debian:unstable [amd64]) []
Inst openssh-client [1:10.0p1-8] (1:10.2p1-3 Debian:testing, Debian:unstable [amd64])
Conf openssh-sftp-server (1:10.2p1-3 Debian:testing, Debian:unstable [amd64])
Conf openssh-server (1:10.2p1-3 Debian:testing, Debian:unstable [amd64])
Conf openssh-client (1:10.2p1-3 Debian:testing, Debian:unstable [amd64])

but I don't understand why there are breaks for openssh-sftp-server
and openssh-server.

Using "-o Debug::pkgProblemResolver=true" does not show additional
information.