Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors from "config-manager" when starting new "bash --login" session after upgrading to v41 #235

Open
mkielar opened this issue Feb 24, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mkielar
Copy link

mkielar commented Feb 24, 2025

Describe the bug
I was running FedoraRemix v39 with WSL1. Then upgraded it to v40, and then to v41, according to instructions here:

Now, whenever I run bash -li, i get this:

Unknown argument "--dump" for command "config-manager". Add "--help" for more information about the arguments.
Unknown argument "--save" for command "config-manager". Add "--help" for more information about the arguments.

After that bash initializes normally, and is usable. I cannot trace the source of the problem.

To Reproduce
Upgrade v39 -> v40 -> v41?

Expected behavior
I'd expect my new bash login sessions not to issue errors.

Screenshots
N/a

Additional context
I was able to trace the issue to the /etc/profile.s/check-dnf.sh script, which currently looks like this:

#!/bin/sh

# Only the default WSL user should run this script
if ! (id -Gn | grep -c "adm.*wheel\|wheel.*adm" >/dev/null); then
  return
fi

if [ -z "${WSL2}" ]; then
  sudo check-dnf
fi

It seems to be running sudo check-dnf, but only for non-WSL2 installations (my case). That latter command resides in /usr/bin/check-dnf and is in fact another shell script that looks like this:

#! /bin/bash

gpgcheck_enabled=$(dnf config-manager --dump '*' | grep -c "gpgcheck = 1")

if [[ ${gpgcheck_enabled} -ge 0 ]]; then
  dnf config-manager --save --setopt=*.gpgcheck=0
fi

The problem seems to be caused by those two invocations of dnf config manager - options --dump and --save do not exists.

This is what dnf config-manager --help returns:

root@mkielar-lapwro:~# dnf config-manager --help
Usage:
  dnf5 [GLOBAL OPTIONS] config-manager <COMMAND> ...

Description:
  Manage main and repositories configuration, variables and add new repositories.

Commands:
  addrepo                       Add repositories from the specified configuration file or define a new repository using user options
  setopt                        Set configuration and repositories options
  unsetopt                      Unset/remove configuration and repositories options
  setvar                        Set variables
  unsetvar                      Unset/remove variables

And this is what dnf --version returns:

dnf5 version 5.2.10.0
dnf5 plugin API version 2.0
libdnf5 version 5.2.10.0
libdnf5 plugin API version 2.1

Loaded dnf5 plugins:
  name: builddep
  version: 1.0.0
  API version: 2.0

  name: changelog
  version: 1.0.0
  API version: 2.0

  name: config-manager
  version: 0.1.0
  API version: 2.0

  name: copr
  version: 0.1.0
  API version: 2.0

  name: needs_restarting
  version: 1.0.0
  API version: 2.0

  name: repoclosure
  version: 1.0.0
  API version: 2.0

  name: reposync
  version: 1.0.0
  API version: 2.0

I've tried running update.sh. It's clean, nothing to upgrade.

Basic Troubleshooting Checklist

[x] I have searched Google for the error message.
[ ] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled.
[ ] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues.
[ ] I have searched the WLinux issues page: https://github.com/WhitewaterFoundry/WLinux/issues.
[ ] I have reset WLinux: Settings->Apps->Apps & features->WLinux->Advanced Options->Reset.
[ ] I have disabled and re-enabled WSL in Windows Features.
[x] I have run Windows 10 updates and restarted.

What other troubleshooting have you attempted? - See "Additional context" above.

Insert here:

Fedora Remix for WSL Version
41.0.0.0

The output of cat /etc/os-release:

NAME="Fedora Remix for WSL"
VERSION="41"
ID=fedoraremixforwsl
ID_LIKE=fedora
VERSION_ID=41
PLATFORM_ID="platform:f41"
PRETTY_NAME="Fedora Remix for WSL"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:41"
HOME_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL"
SUPPORT_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL"
BUG_REPORT_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL/issues"
PRIVACY_POLICY_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL/blob/master/PRIVACY.md"
FEDORA_REMIX_VERSION=41.0.0

Insert here:

Windows Build

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here:

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22631 N/A Build 22631
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
BIOS Version:              Dell Inc. 1.28.0, 06/11/2024

For help on retrieving: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#check-your-build-number

@crramirez crramirez self-assigned this Feb 24, 2025
@crramirez crramirez added the bug Something isn't working label Feb 24, 2025
@crramirez
Copy link
Contributor

Wow, what a detailed bug report. Thanks a lot for the contribution. The reason for this script was because dnf stopped working with WSL1 due to the gpgcheck. Maybe with dnf5 this is not necessary anymore. We will do the tests and submit the correction.

Best

@mkielar
Copy link
Author

mkielar commented Feb 24, 2025

Seems like these two files:

have not been updated in 4 years, and in the meantime dnf was upgraded to v5 (from v4) and that introduced some breaking changes in its command-line arguments.

I asked Claude for help, and it suggested to directly set the gpgcheck flag like below:

dnf5 config-manager setopt 'gpgcheck=0'
dnf5 config-manager setopt '*.gpgcheck=0'
dnf5 config-manager setopt '*.repo_gpgcheck=0'

However, I'm not sure I know what I'm doing... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants