Subscription-manager refresh not updating repos in Ubuntu under /etc/apt/sources.list.d/rhsm.sources

I deleted security related repository of Ubuntu eg. Index of /ubuntu from UI , then publish new version of the CV.
On client end I ran

subscription-manager refresh
 apt update

below error observed

OSError: Could not find the TLS certificate file, invalid path: /etc/pki/entitlement/9173575530515010443.pem
Ign:19 katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security default/all all Packages
Ign:24 katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_20_04 default/all all Packages
Err:25 katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_20_04 default/all amd64 Packages
  OSError: Could not find the TLS certificate file, invalid path: /etc/pki/entitlement/9173575530515010443.pem
Ign:26 katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_20_04 default/all Translation-en_US
Ign:30 katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_focal default/all all Packages
Err:31 katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_focal default/all amd64 Packages
  OSError: Could not find the TLS certificate file, invalid path: /etc/pki/entitlement/1639995247242990338.pem
Ign:32 katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_focal default/all Translation-en_US
Reading package lists... Done
E: Failed to fetch katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security/dists/default/all/binary-amd64/Packages  OSErroritlement/9173575530515010443.pem
E: Failed to fetch katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_20_04/dists/default/all/binary-amd64/Packages  Oki/entitlement/9173575530515010443.pem
E: Failed to fetch katello://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_focal/dists/default/all/binary-amd64/Packages  Oki/entitlement/1639995247242990338.pem
E: Some index files failed to download. They have been ignored, or old ones used instead

I then verified under /etc/apt/sources.list.d/rhsm.sources and observed it was still showing the repository

name: Ubuntu_security_20.04_uni
baseurl: https://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_20_04
enabled: 1
gpgcheck: 0
sslverify: 1
sslcacert: /etc/rhsm/ca/katello-server-ca.pem
sslclientkey: /etc/pki/entitlement/9173575530515010443-key.pem
sslclientcert: /etc/pki/entitlement/9173575530515010443.pem
metadata_expire: 1
enable_metadata: 0
arches: none
enabled_metadata: 1
Types: deb
URIs: katello://9173575530515010443@hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_20_04
Suites: default
Components: all
Trusted: yes
id: Tcl_IT_Ubuntu_Ubuntu_security_20_04

name: Ubuntu_security_focal
baseurl: https://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_focal
enabled: 1
gpgcheck: 0
sslverify: 1
sslcacert: /etc/rhsm/ca/katello-server-ca.pem
sslclientkey: /etc/pki/entitlement/1639995247242990338-key.pem
sslclientcert: /etc/pki/entitlement/1639995247242990338.pem
metadata_expire: 1
enable_metadata: 0
arches: none
enabled_metadata: 1
Types: deb
URIs: katello://1639995247242990338@hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security_focal
Suites: default
Components: all
Trusted: yes
id: Tcl_IT_Ubuntu_Ubuntu_security_focal

output from hammer shell as below

hammer> repository list
---|-------------------------|---------------|--------------|-----------------------------------------------------------------
ID | NAME                    | PRODUCT       | CONTENT TYPE | URL
---|-------------------------|---------------|--------------|-----------------------------------------------------------------
26 | debian 11               | Debian        | deb          | http://deb.debian.org/debian
1  | RL AppStream8           | Rocky-Linux-8 | yum          | https://download.rockylinux.org/pub/rocky/8/AppStream/x86_64/os/
2  | Ubuntu 20.04 main       | Ubuntu        | deb          | http://archive.ubuntu.com/ubuntu/
3  | ubuntu 20.04 restricted | Ubuntu        | deb          | http://archive.ubuntu.com/ubuntu/
10 | Ubuntu 20.04 universe   | Ubuntu        | deb          | http://archive.ubuntu.com/ubuntu
---|-------------------------|---------------|--------------|-----------------------------------------------------------------
hammer> exit

I fixed the error after manually disabling the repos in rhsm.sources file i.e.

root@host:~# grep -i secu -A2 /etc/apt/sources.list.d/rhsm.sources
name: Ubuntu_security
baseurl: https://hostname/pulp/deb/Tcl_IT/Library/Ubuntu/custom/Ubuntu/Ubuntu_security
enabled: 0
gpgcheck: 0
--

Wanted to understand why subscription-manger refresh command didn’t update the rhsm.sources file

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.