How to add repos on dnf5

how to add repos usin dnf5 since --add-repo command is not valid on dnf5

https://dnf5.readthedocs.io/en/latest/dnf5_plugins/config-manager.8.html

3 Likes

how to fix this since autorefresh not found

Error in added repository configuration file. Cannot set repository option "autorefresh=1": Option "autorefresh" not found

What command did you run to get that error?

phatle@fedora:~$ sudo dnf config-manager addrepo --from-repofile=https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
Place your right index finger on the fingerprint reader
 https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo                            100% | 196.0   B/s | 124.0   B |  00m01sError in added repository configuration file. Cannot set repository option "autorefresh=1": Option "autorefresh" not found

That doesn’t appear to be an available configuration option. DNF5 Configuration Reference — dnf5 documentation

https://dnf5.readthedocs.io/en/latest/index.html

You may need to download the repo file, edit it and remove that option.

It’s also not a dnf4 option either according to DNF Configuration Reference — DNF @DNF_VERSION@-1 documentation
I guess an unknown option was ignored before?

thats interesting since rpm installation fails due no key signed files

might be brave browser issues too combined to dnf

Brave don’t work for me either using dnf5 on F41, but for now work using dnf4:

# https://brave.com/linux/
sudo dnf install dnf-plugins-core
sudo dnf4 config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
sudo dnf install brave-browser

Altenatively

echo -e '[brave-browser]\nname=Brave Browser\nbaseurl=https://brave-browser-rpm-release.s3.brave.com/$basearch\nenabled=1\nautorefresh=1' | sudo tee /etc/yum.repos.d/brave-browser.repo > /dev/null
sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
sudo dnf install brave-browser

It looks like autorefresh is an option that is used by Zypper in Suse and was ignored in dnf4.

You can also add these manually by referencing the repo file.

[brave-browser]
name=Brave Browser
enabled=1
autorefresh=1
baseurl=https://brave-browser-rpm-release.s3.brave.com/$basearch

This would translate to:
sudo dnf config-manager addrepo --id=brave-browser --set=name='Brave Browser' --set=baseurl='https://brave-browser-rpm-release.s3.brave.com/$basearch'

Single quotes are important for the baseurl.

2 Likes

this works no issues at all

Added dnf5