Dnf throws errors whenever i try to do anything

,

Title pretty much says it all. I have F39 (Updated from 38) and dnf doesn’t work except just typing dnf and getting list of arguments i can use but all the arguments i tried to use throw error

Here it is:

Traceback (most recent call last):
File “/usr/bin/dnf”, line 62, in
main.user_main(sys.argv[1:], exit_code=True)
File “/usr/lib/python3.12/site-packages/dnf/cli/main.py”, line 201, in user_main
errcode = main(args)
^^^^^^^^^^
File “/usr/lib/python3.12/site-packages/dnf/cli/main.py”, line 67, in main
return _main(base, args, cli_class, option_parser_class)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/site-packages/dnf/cli/main.py”, line 102, in _main
cli.configure(list(map(ucd, args)), option_parser())
File “/usr/lib/python3.12/site-packages/dnf/cli/cli.py”, line 877, in configure
self._configure_repos(opts)
File “/usr/lib/python3.12/site-packages/dnf/cli/cli.py”, line 653, in _configure_repos
self.base.read_all_repos(opts)
File “/usr/lib/python3.12/site-packages/dnf/base.py”, line 552, in read_all_repos
for repo in reader:
File “/usr/lib/python3.12/site-packages/dnf/conf/read.py”, line 57, in iter
for r in self._get_repos(repofn):
File “/usr/lib/python3.12/site-packages/dnf/conf/read.py”, line 124, in _get_repos
thisrepo = self._build_repo(parser, ucd(section), repofn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/site-packages/dnf/conf/read.py”, line 81, in _build_repo
repo.populate(parser, id, repofn, dnf.conf.PRIO_REPOCONFIG)
File “/usr/lib/python3.12/site-packages/dnf/conf/config.py”, line 149, in _populate
self._config.optBinds().at(name).newString(priority, value)
File “/usr/lib64/python3.12/site-packages/libdnf/conf.py”, line 1063, in newString
return _conf.OptionBinds_Item_newString(self, priority, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: in method ‘OptionBinds_Item_newString’, argument 3 of type ‘std::string const &’

Please use the preformatted text tool (or wrap in ```). That traceback is hard to read as-is. It also seems like the error at the end is truncated. Is there any more to that line?

My guess is that there’s something invalid in one of your repo configuration files in /etc/yum.repos.d/. It would definitely be a bug that dnf crashes like this though.

I can’t seem to understand how to use the formatting you advised. As for the errror there is nothing more to it than what i posted.

What can i do about it? Delete non-default repos and check?

Please keep a copies of them, but yes, you can try moving away all the repos except fedora-*.repo

Thank you very much. I found the one and now it works!