brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.97k stars 2.35k forks source link

Brave installation tutorial does not work with DNF5 #42033

Open fornasierov opened 4 weeks ago

fornasierov commented 4 weeks ago

Description

On the Brave linux installation webpage (https://brave.com/linux/), the following command is indicated in order to add the Brave repository:

sudo dnf config-manager --add-repo https://brave-browser-rpm-nightly.s3.brave.com/brave-browser-nightly.repo

Which results on the following when using DNF5 (I'm using Fedora 41):

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

This happens because DNF5 config-manager no longer utilizes the argument --add-repo, instead it uses addrepo. The following is the new correct syntax:

sudo dnf config-manager addrepo --from-repofile=https://brave-browser-rpm-nightly.s3.brave.com/brave-browser-nightly.repo

Steps to reproduce

  1. Install Fedora 41
  2. Attempt to install Brave Browser via it's tutorial webpage (https://brave.com/linux/)

Actual result

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

Expected result

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

Which is an expected result given based on this other issue.

Reproduces how often

Easily reproduced

Brave version (brave://version info)

Love Brave, hopefully you all update the repository settings to start supporting DNF5.

Channel information

Reproducibility

Miscellaneous information

No response

Angxddeep commented 3 weeks ago

Here's another thing now if you use the new command it gives this error Error in added repository configuration file Cannot set repository option "autorefresh=1": Option "autorefresh" not found

Brave team will have to remove autorefresh=1 from the repo file on the server side too

Angxddeep commented 1 week ago

@fmarier sorry for the ping, but I think this issue got overlooked because of so many other issues, so just letting you know this exists.

fmarier commented 1 week ago

Hm, I guess we'll have to have a separate .repo file for DNF5 because OpenSUSE needs autorefresh.

cc @wknapik @oajara

wknapik commented 1 week ago

Looks like in Fedora 41 yum and dnf are both symlinked to dnf5, but only the latter has broken backwards compatibility.

Since dnf5 is the future, we indeed need separate instructions and separate repo files (cc @oajara).

In install.sh we could just prioritize yum over dnf, but we want to follow the user's preferences, so I'd go with a check for the dnf version and different lines to add the repo.

fmarier commented 1 week ago

Since dnf5 is the future, we indeed need separate instructions and separate repo files (cc @oajara).

Separate repo files, yes.

How long are Fedora releases supported? Are users likely to be installing on Fedora releases with dnf? If they are, then we should have two sets of instructions. Otherwise we could simply replace dnf with dnf5 in the instructions. install.sh should support both because that's easy to do (and you've already done it).

wknapik commented 1 week ago

How long are Fedora releases supported? Are users likely to be installing on Fedora releases with dnf? If they are, then we should have two sets of instructions. Otherwise we could simply replace dnf with dnf5 in the instructions.

% for ver in {27..41}; do printf "fedora:$ver: "; docker run --rm "fedora:$ver" sh -c "dnf --version|head -n1"; done   
fedora:27: 2.7.5
fedora:28: 2.7.5
fedora:29: 4.1.0
fedora:30: 4.2.17
fedora:31: 4.2.21
fedora:32: 4.6.0
fedora:33: 4.9.0
fedora:34: 4.9.0
fedora:35: 4.14.0
fedora:36: 4.15.0
fedora:37: 4.18.0
fedora:38: 4.19.2
fedora:39: 4.18.2
fedora:40: 4.21.1
fedora:41: dnf5 version 5.2.6.2
%

We have to support both <5 and 5

Angxddeep commented 1 week ago

Fedora 40 will be EOL on 2025-05-28, and along with it dnf 4.21.1

fmarier commented 1 week ago

Fedora 40 will be EOL on 2025-05-28, and along with it dnf 4.21.1

Thanks @Angxddeep . So we definitely have to support both.

oajara commented 3 days ago

Hm, I guess we'll have to have a separate .repo file for DNF5 because OpenSUSE needs autorefresh.

cc @wknapik @oajara

Shouldn't we have a separate .repo file for openSUSE instead? That way, the .repo file in the instructions for all YUM/DNF-based distros stays the same, and we change the URL in the instructions for openSUSE.

wknapik commented 3 days ago

@oajara Fedora 41 comes with dnf5, which would also fail on the current .repo file, as the issue description explains.

$ dnf config-manager addrepo --from-repofile=https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
Error in added repository configuration file. Cannot set repository option "autorefresh=1": Option "autorefresh" not found
$
wknapik commented 3 days ago

For anyone following this issue - @oajara explained elsewhere that only openSUSE needs autorefresh and dnf/yum, regardless of version, don't need it and dnf5 will in fact fail on it. WIP.

WinWeirdo commented 3 days ago

if anyone is looking for a workaround: sudo dnf config-manager addrepo --id=brave-browser --set=name='Brave Browser' --set=baseurl='https://brave-browser-rpm-release.s3.brave.com/$basearch' found it on https://discussion.fedoraproject.org/t/how-to-add-repos-on-dnf5/131574/9

wknapik commented 1 day ago

The autorefresh=1 issue should be resolved. Installation instructions for dnf5-based distros will have to be added.