brave / brave-browser

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

brave-browser launches the most recent install (.deb packages) #1324

Closed srirambv closed 5 years ago

srirambv commented 5 years ago

Description

brave-browser launches the most recent install

Steps to Reproduce

  1. Install Brave-Browser-Dev on Linux
  2. Run brave-browser from terminal launches Dev build
  3. Install Brave-Browser-Beta after installing Brave-Browser-Dev
  4. Run brave-browser from terminal launches Beta build
  5. Uninstall Beta from terminal shows updating alternatives which starts to point brave-browser to brave-browser-dev image

Actual result:

brave-browser launches the most recent install of Brave(Dev/Beta)

Expected result:

brave-browser should not launch Beta/Dev build, should be specified only for Release build. Only brave-browser-dev should launch Dev build and brave-browser-beta should launch Beta build

Reproduces how often:

Easy

Brave version (chrome://version info)

All Linux version

Reproducible on current release:

N/A for b-l

Website problems only:

Additional Information

mihaiplesa commented 5 years ago

Related to https://github.com/brave/brave-browser/issues/1746 https://github.com/brave/brave-browser/issues/1032 https://github.com/brave/brave-browser/issues/1888

srirambv commented 5 years ago

+1 from @Techguyprivate via #2281

Techguyprivate commented 5 years ago

Please solve the problem . It is now over a month . I am able to use brave stable for the last 3 days cause brave stable got recently updated. So I am able to open it. Otherwise , if a new beta/dev version will get published & updated , I will be unable to use brave stable . I didn't able to use my Brave stable for 20 days , where all my passwords, bookmarks are stored.

srirambv commented 5 years ago

++ on uplifting this. Gets really hard for testing as well.

cc: @rebron @kjozwiak @bbondy

Techguyprivate commented 5 years ago

Meantime, any tweaks, workarounds, solution, clever or dirty hacks. Thank you.

srirambv commented 5 years ago

@Techguyprivate the only work around(sorry for this) I can suggest for now is to uninstall and reinstall the release version once beta gets updated via apt update. This shortcut issue only affects release and beta channels.

Techguyprivate commented 5 years ago

I didn't understand. I should wait for a beta update ? After updating the beta , only and only then , I should uninstall, and reinstall release. If I uninstall the stable normal way, not purge or anything else in Linux mint , will I lose my tons of bookmarks, passwords, history? Thank you in advance anyway for such a product & service.

srirambv commented 5 years ago

@Techguyprivate I think i put the workaround in a wrong way. Here's what you can do to actually use both release/beta without having to purge your profile. If you install a new beta build, then release and beta shortcut will launch only beta so you can just run the following steps to retain your release profile

sudo apt remove brave-browser
sudo apt install brave-browser

☝️ this will just remove the release version that is installed and reinstall the latest one keeping your profile intact.

kjozwiak commented 5 years ago

++ on uplifting this. Gets really hard for testing as well.

cc: @rebron @kjozwiak @bbondy

@srirambv moving this into the General project board so we can discuss and triage it in our next meeting 👍

Techguyprivate commented 5 years ago

Solved for Windows and ubuntu without uninstalling anything.

Not solved for Linux mint 19.1 .

fmarier commented 5 years ago

Here's my work-around for this on Ubuntu 18.04:

cd /etc/alternatives/
rm brave-browser
ln -s /opt/brave.com/brave/brave-browser .

After this, launching brave-browser will launch the release browser as expected.

The problem is twofold:

  1. Both the beta and dev packages divert the /usr/bin/brave-browser binary.
  2. The brave-browser package doesn't register its binary as an alternative for the /usr/bin/brave-browser binary.

You can see that second point by doing:

$ update-alternatives --config brave-browser
There are 2 choices for the alternative brave-browser (providing /usr/bin/brave-browser).

  Selection    Path                         Priority   Status
------------------------------------------------------------
  0            /usr/bin/brave-browser-beta   150       auto mode
  1            /usr/bin/brave-browser-beta   150       manual mode
  2            /usr/bin/brave-browser-dev    0         manual mode

Press <enter> to keep the current choice[*], or type selection number: 

I do agree with the expected result from the bug description. We should remove the diversion from the -beta and -dev packages.

riastradh-brave commented 5 years ago

No opinion on whether /usr/bin/brave-browser should be a symlink to an alternative, but at least the release, beta, and dev packages should agree on whether the /usr/bin/brave-browser file is a symlink to an alternative -- currently the beta and dev packages think it is, and update it with update-alternatives, while the release package thinks it isn't, so it is not presented as an alternative.

In other words, either the following fragments should be unconditional on the release channel (and the executable should be installed at the distinct pathname /usr/bin/brave-browser-release, or the symlinks should point at /opt/brave.com/brave-<channel>/brave-browser-<channel>, or something), or they shouldn't happen at all:

# brave-browser.postinst
if [ '"brave-browser"' != '"brave-browser"' ]; then
  update-alternatives --install /usr/bin/brave-browser brave-browser \
    /usr/bin/brave-browser $PRIORITY
fi

# brave-browser-beta.postinst
if [ '"brave-browser"' != '"brave-browser-beta"' ]; then
  update-alternatives --install /usr/bin/brave-browser brave-browser \
    /usr/bin/brave-browser-beta $PRIORITY
fi

# brave-browser-dev.postinst
if [ '"brave-browser"' != '"brave-browser-dev"' ]; then
  update-alternatives --install /usr/bin/brave-browser brave-browser \
    /usr/bin/brave-browser-dev $PRIORITY
fi
Techguyprivate commented 5 years ago

Today, Clicking on brave stable , open up brave beta on Ubuntu & Linux mint . I did remove brave , then installed it as suggested above. But the problem still occurs.

fmarier commented 5 years ago

@Techguyprivate did you try the work-around mentioned above?

As the root user:

cd /etc/alternatives/
rm brave-browser
ln -s /opt/brave.com/brave/brave-browser .
Techguyprivate commented 5 years ago

@fmarier It solved the problem. But I can confirm that I did the following in my various linux os few months ago.

" sudo apt remove brave-browser sudo apt install brave-browser " as suggested by .

But the problem reappears again & again. As far as I can remember, recently the stable release got updated to chromium 72.121 something( for the file api security bug ) and then to chromium 73 . After that updating the beta releases , the problem reappears.

For some more information, I have 3 release channels installed, cause I want to test , learn, get acquainted with the BAT system & ad systems. I recently installed nightly releases even. But on my ubuntu , I have no nightly release installed cause I saw the nightly releases recently, but the problem persists.

Techguyprivate commented 5 years ago

@fmarier Will changing the directory or removing brave browser , remove my profile?

The problem is little frustrating cause I have lot of sites with already logged in , in brave stable like fb, twitter,more importantly bank sites & other numerous sites. Whenever I log into any sites or any sites that require my password, I give much attention to the url for phishing attacks. Also I use long passwords , so typing long passwords again & again is frustrating, even if I use keepass .

The problem is that I am facing this issue for the last 6 months continously when brave stable or beta updated. I don't get access to the brave stable once brave beta updated. Then clicking on brave stable opens up brave beta. SO I get locked out of brave stable. I can't use brave beta cause it is beta. so.

fmarier commented 5 years ago

Yes, that work-around is only temporary. As soon as brave-browser-beta or brave-browser-dev gets updated, the symlink needs to be fixed again.

You're right, it's really annoying. I have the same problem on my laptop. I will try to get to it soon.

kjozwiak commented 5 years ago

@rebron we need to revisit this and reprioritize to either P3 or P2. We're going to have more users on linux running into the above the more we promote the different channels.

Techguyprivate commented 5 years ago

Just want to state that today brave stable got updated to 61.52 (with an Upgraded Chromium to 73.0.3683.86) , the problem reappeared again. Just yesterday, I ran the following.

cd /etc/alternatives/ rm brave-browser ln -s /opt/brave.com/brave/brave-browser .

Quiet a irritating problem. Again & again , I am accidentally opening up Brave beta ( although I am clicking on Brave stable) . Happened at least 20 times in 6months. Now-a-days , I forced to go to about page to see whether it is brave stable or beta.

But anyway, thank you for the awesome product.

fmarier commented 5 years ago

A simpler fix than the one I suggested previously is to simply rename the binary shipped by the release package in /usr/bin/ to /usr/bin/brave-browser-stable and let that get installed as the highest-priority alternative for the /usr/bin/brave-browser binary.

That's what the Fedora packages do already:

[root@fedora29 etc]# ls -l /usr/bin/brave*
lrwxrwxrwx 1 root root 31 Mar 25 21:45 /usr/bin/brave-browser -> /etc/alternatives/brave-browser
lrwxrwxrwx 1 root root 44 Feb 20 19:00 /usr/bin/brave-browser-beta -> /opt/brave.com/brave-beta/brave-browser-beta
lrwxrwxrwx 1 root root 42 Mar 24 09:06 /usr/bin/brave-browser-dev -> /opt/brave.com/brave-dev/brave-browser-dev
lrwxrwxrwx 1 root root 34 Mar 21 06:10 /usr/bin/brave-browser-stable -> /opt/brave.com/brave/brave-browser

[root@fedora29 etc]# ls -l /etc/alternatives/brave-browser 
lrwxrwxrwx 1 root root 29 Mar 25 21:45 /etc/alternatives/brave-browser -> /usr/bin/brave-browser-stable

[root@fedora29 etc]# update-alternatives --config brave-browser

There are 3 programs which provide 'brave-browser'.

  Selection    Command
-----------------------------------------------
   1           /usr/bin/brave-browser-beta
*+ 2           /usr/bin/brave-browser-stable
   3           /usr/bin/brave-browser-dev

and so this is only a regression on Debian-based systems since brave/brave-core#45 (specifically https://github.com/brave/brave-core/pull/45/commits/c693f8901139957f6395d9087d23ac04191e69a5) got merged.

Techguyprivate commented 5 years ago

Again, opened up brave beta when clicking on brave stable. Is it solved ? Or do I need to do anything else other than the things mentioned above?

Thank you in advanced anyway.

fmarier commented 5 years ago

It's solved in version 0.66, which isn't released yet (the current one is 0.63). Until that version comes out, you will, unfortunately, have to use the steps from https://github.com/brave/brave-browser/issues/1324#issuecomment-474936837.

I appreciate your patience with this. My apologies for the time it took to get this resolved.

srirambv commented 5 years ago

Verification passed by @GeetaSarvadnya on

Brave 0.66.98 Chromium: 75.0.3770.100 (Official Build) beta(64-bit)
Revision cd0b15c8b6a4e70c44e27f35c37a4029bad3e3b0-refs/branch-heads/3770@{#1033}
OS Linux