Dnf yum no longer able to update - mostly solved - questions left

While I was trying to enable the crb to install a missing package for building a qt(5) app that wasn’t available from the repos (stremio), I accidentally typed the wrong thing and broke my package management completely. You will see what folder I was building in… haha

DO NOT TYPE THIS!

[karen@resolve-ws build]$ sudo dnf config-manager --add-repo crb

It will result in the following (or similar) error:

[karen@resolve-ws ~]$ sudo dnf update
created by dnf config-manager from file:///home/karen/Videos/stremio-shell/build/crb             0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'home_karen_Videos_stremio-shell_build_crb':
  - Curl error (37): Couldn't read a file:// file for file:///home/karen/Videos/stremio-shell/build/crb/repodata/repomd.xml [Couldn't open file /home/karen/Videos/stremio-shell/build/crb/repodata/repomd.xml]
Error: Failed to download metadata for repo 'home_karen_Videos_stremio-shell_build_crb': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

In hind sight I should have done this:
sudo dnf config-manager --set-enabled crb

or in the event I had already done that (which I think I had, but whatever…) I could have been wanting this:
sudo crb status and then this sudo crb enable before sudo dnf --enablerepo=crb install meson or this sudo dnf install meson.

I’m clearly new at this and forgot how to use a new command to me and screwed it up… HOPEFULLY for your amusement. :laughing:

I was able to figure out how to solve it by:

[karen@resolve-ws ~]$ sudo dnf repolist
repo id                                    repo name
appstream                                  Rocky Linux 9 - AppStream
baseos                                     Rocky Linux 9 - BaseOS
crb                                        Rocky Linux 9 - CRB
cuda-rhel9-x86_64                          cuda-rhel9-x86_64
docker-ce-stable                           Docker CE Stable - x86_64
elrepo                                     ELRepo.org Community Enterprise Linux Repository - el9
elrepo-extras                              ELRepo.org Community Enterprise Linux Extras Repository - el9
epel                                       Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264                        Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras                                     Rocky Linux 9 - Extras
highavailability                           Rocky Linux 9 - High Availability
home_karen_Videos_stremio-shell_build_crb  created by dnf config-manager from file:///home/karen/Videos/stremio-shell/build/crb
nfv                                        Rocky Linux 9 - NFV
plus                                       Rocky Linux 9 - Plus
resilientstorage                           Rocky Linux 9 - Resilient Storage
rpmfusion-free-updates                     RPM Fusion for EL 9 - Free - Updates
rpmfusion-nonfree-updates                  RPM Fusion for EL 9 - Nonfree - Updates
[karen@resolve-ws ~]$ sudo dnf config-manager --set-disabled home_karen_Videos_stremio-shell_build_crb
[karen@resolve-ws ~]$ sudo dnf update
Rocky Linux 9 - BaseOS                                                                           5.6 kB/s | 4.1 kB     00:00    
Rocky Linux 9 - AppStream                                                                        6.7 kB/s | 4.5 kB     00:00    
Rocky Linux 9 - CRB                                                                              7.2 kB/s | 4.5 kB     00:00    
Dependencies resolved.
Nothing to do.
Complete!

However, In the past when I’ve had broken repo configurations on other distors I get an error that warns me that one of the repos was not reachable and then the system continues to update normally. For instance, in the past I used a custom repo for my vpn which at some point stopped getting supported in favour of using flatpaks/snapd. When the repo died, debian continued to update, but the vpn stopped updating and the message remained until I removed the entery from my repo list.

If nvidia cuda repos break/become unreachable sometime, will my whole system no longer update anymore or did I just do something completely different that totally broke my system’s ability to update?

Is there a way to setup the dnf/yum system such that if someone new like me makes an error like that again that it points out the error and still allows the system to update properly? or is this by design for people to be able to customize there update process in a way I just don’t understand/need?

Should you have read this all and be willing to answer my curiosity, thank you so much! I posted the solution and the error in case someone else screws it up like me (o:

Karen

See man dnf.conf

The dnf config-manager and crb are helper utilities so that one does not have to edit the /etc/yum.repos.d/*.repo files directly. (Most files there are installed from RPM packages and never need edits.)

One option for repo is skip_if_unavailable


I’ve recently shifted to use Ansible for configuration management.
I can have a task like below in a “playbook” and if I also have values in used variables (e.g. repositories_thirdparty), then the play will ensure that I have those repo defs in my system. A nice part is that it is easy to keep a backup copy of plays and variables (all text – yaml) and to rerun the play.

- name: Define third-party repositories
  ansible.builtin.yum_repository:
    name:            "{{ item.name }}"
    file:            "{{ item.file | default(omit) }}"
    description:     "{{ item.description }}"
    mirrorlist:      "{{ item.mirrorlist | default(omit) }}"
    baseurl:         "{{ item.baseurl | default(omit) }}"
    metalink:        "{{ item.metalink | default(omit) }}"
    cost    :        "{{ item.cost | default(omit) }}"
    failovermethod:  "{{ item.failovermethod | default(omit) }}"
    gpgkey:          "{{ item.gpgkey | default(omit) }}"
    metadata_expire: "{{ item.metadata_expire | default(omit) }}"
    exclude:         "{{ item.exclude | default(omit) }}"
    gpgcheck:        "{{ item.gpgcheck | default(true) }}"
    repo_gpgcheck:   "{{ item.repo_gpgcheck | default(omit) }}"
    enabled:         "{{ item.enabled | default(false) }}"
    skip_if_unavailable: "{{ item.skip_if_unavailable | default(omit) }}"
  when: lookup('vars', 'use_' + item.id)
  loop: "{{ repositories_thirdparty }}"
  loop_control:
    label: "{{ item.name }}"
1 Like