Ubuntu 22.04 apt list --upgradable package

I have a problem on ubuntu 22.04 and foreman-3.4.0-0.7.rc2.el8.
after registering the ubuntu client in foreman with the subscription-manager register command.

apt update is ok, but when displaying the list of packages to update with apt list --upgradable, I can’t see which repository it comes from.

root@pre-release01x:/etc/apt/sources.list.d# apt update
Ign:1 katello://gforeman01x.info.swissquote.ch/pulp/deb/Default_Organization/DEV_UBUNTU_22/CV_UBUNTU_22/custom/Ubuntu/jammy-security default InRelease
Get:2 katello://gforeman01x.info.swissquote.ch/pulp/deb/Default_Organization/DEV_UBUNTU_22/CV_UBUNTU_22/custom/Ubuntu/jammy-security default Release [1,608 B]
Ign:3 katello://gforeman01x.info.swissquote.ch/pulp/deb/Default_Organization/DEV_UBUNTU_22/CV_UBUNTU_22/custom/Ubuntu/jammy-security default Release.gpg
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
33 packages can be upgraded. Run ‘apt list --upgradable’ to see them.

root@pre-release01x:/etc/apt/sources.list.d# apt list --upgradable
Listing… Done
bind9-dnsutils**/unknown** 1:9.18.1-1ubuntu1.2 amd64 [upgradable from: 1:9.18.1-1ubuntu1.1]
bind9-host/unknown 1:9.18.1-1ubuntu1.2 amd64 [upgradable from: 1:9.18.1-1ubuntu1.1]
bind9-libs/unknown 1:9.18.1-1ubuntu1.2 amd64 [upgradable from: 1:9.18.1-1ubuntu1.1]

root@pre-release01x:/etc/apt/sources.list.d# cat rhsm.sources
name: jammy-security
baseurl: https://gforeman01x.info.swissquote.ch/pulp/deb/Default_Organization/DEV_UBUNTU_22/CV_UBUNTU_22/custom/Ubuntu/jammy-security
enabled: 1
gpgcheck: 0
sslverify: 1
sslcacert: /etc/rhsm/ca/katello-server-ca.pem
sslclientkey: /etc/pki/entitlement/5990320218978200124-key.pem
sslclientcert: /etc/pki/entitlement/5990320218978200124.pem
metadata_expire: 1
enable_metadata: 0
arches: amd64
enabled_metadata: 1
Types: deb
URIs: katello://5990320218978200124@gforeman01x.info.swissquote.ch/pulp/deb/Default_Organization/DEV_UBUNTU_22/CV_UBUNTU_22/custom/Ubuntu/jammy-security
Suites: default
Components: all
Trusted: yes
Architectures: amd64

when I delete /etc/apt/sources.list.d/rhsm.sources and put the same repository as before jammy-security but in deb form it works:

root@pre-release01x:/etc/apt/sources.list.d# apt update
Ign:1 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security InRelease
Get:2 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security Release [6,322 B]
Ign:3 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security Release.gpg
Get:4 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security/main amd64 Packages [298 kB]
Get:5 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security/main all Packages [57.6 kB]
Get:6 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security/restricted amd64 Packages [303 kB]
Get:7 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security/restricted all Packages [1,916 B]
Get:8 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security/universe all Packages [88.4 kB]
Get:9 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security/universe amd64 Packages [177 kB]
Get:10 https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security jammy-security/multiverse amd64 Packages [2,673 B]
Fetched 934 kB in 0s (4,617 kB/s)
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
33 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
root@pre-release01x:/etc/apt/sources.list.d# apt list --upgradable
Listing… Done
bind9-dnsutils/jammy-security 1:9.18.1-1ubuntu1.2 amd64 [upgradable from: 1:9.18.1-1ubuntu1.1]
bind9-host/jammy-security 1:9.18.1-1ubuntu1.2 amd64 [upgradable from: 1:9.18.1-1ubuntu1.1]
bind9-libs/jammy-security 1:9.18.1-1ubuntu1.2 amd64 [upgradable from: 1:9.18.1-1ubuntu1.1]

with the repository in deb form, I can see that the package comes from the jammy-security repo.
Is there a config for apt to set up?
I haven’t found any docs for this problem, only information on 50unattended-upgrades

Regards Mathieu

This is sort of a known issue, but my working theory to date, was that this is a consequence of the way Katello structures APT repos. I was not aware that converting rhsm.sources to deb format “fixes” this.

This suggests that this is really a bug in apt list (which should in theory support both formats).
This is helpful new information (and I will update our internal ticket), but I can’t say when or how this will ultimately be fixed.

deleting rhsm.sources and creating a .list file as follows works:

echo ‘deb [arch=amd64 trusted=yes] https://gforeman01x.info.swissquote.ch/pulp/content/Default_Organization/Library/custom/Ubuntu/jammy-security/ jammy-security main restricted universe multiverse’ > /etc/apt/sources.list.d/jammy-security.list

but the problem is that we do not use the content view and not the life cycle environment.

The real problem is that if I put the 3 repositories jammy, jammy-update and jammy-security.

When I list the packages that are not up to date, it gives me a complete list of packages without the source repository

apt/unknown 2.4.5 amd64 [upgradable from: 2.0.6]
at/unknown 3.2.5-1ubuntu1 amd64 [upgradable from: 3.1.23-1ubuntu1]
augeas-lenses/unknown 1.13.0-1 all [upgradable from: 1.12.0-1build1]

So I can’t do an upgrade of jammy-security package by unattended-upgrades because I have all the packages up to date not just the security ones.