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

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

Closed
srirambv opened this issue Sep 27, 2018 · 23 comments · Fixed by brave/brave-core#2101
Closed

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

srirambv opened this issue Sep 27, 2018 · 23 comments · Fixed by brave/brave-core#2101

Comments

@srirambv
Copy link
Contributor

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:

  • Does the issue resolve itself when disabling Brave Shields?
  • Is the issue reproducible on the latest version of Chrome?

Additional Information

@srirambv srirambv added bug OS/Linux priority/P4 Planned work. We expect to get to it "soon". release/not-blocking labels Sep 27, 2018
@srirambv srirambv added this to the 1.x Backlog milestone Sep 27, 2018
@mihaiplesa
Copy link
Contributor

mihaiplesa commented Nov 28, 2018

Related to #1746 #1032 #1888

@srirambv
Copy link
Contributor Author

srirambv commented Dec 5, 2018

+1 from @Techguyprivate via #2281

@Techguyprivate
Copy link

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
Copy link
Contributor Author

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

cc: @rebron @kjozwiak @bbondy

@Techguyprivate
Copy link

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

@srirambv
Copy link
Contributor Author

srirambv commented Jan 2, 2019

@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
Copy link

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
Copy link
Contributor Author

srirambv commented Jan 3, 2019

@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
Copy link
Member

kjozwiak commented Jan 8, 2019

++ 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
Copy link

Solved for Windows and ubuntu without uninstalling anything.

Not solved for Linux mint 19.1 .

@fmarier
Copy link
Member

fmarier commented Jan 16, 2019

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.

@rebron rebron removed this from the 1.x Backlog milestone Feb 7, 2019
@riastradh-brave
Copy link
Contributor

riastradh-brave commented Mar 3, 2019

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
Copy link

Techguyprivate commented Mar 20, 2019

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
Copy link
Member

fmarier commented Mar 20, 2019

@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 .

@fmarier fmarier self-assigned this Mar 20, 2019
@Techguyprivate
Copy link

@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
Copy link

@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
Copy link
Member

fmarier commented Mar 20, 2019

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
Copy link
Member

@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
Copy link

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.

@rebron rebron added the priority/P2 A bad problem. We might uplift this to the next planned release. label Mar 25, 2019
@rebron rebron removed the priority/P4 Planned work. We expect to get to it "soon". label Mar 25, 2019
fmarier added a commit to fmarier/brave-core that referenced this issue Mar 26, 2019
This fixes brave/brave-browser#1324 by ensuring that the release
package can also provide an alternative (of higher priority) for
the /usr/bin/brave-browser binary.

With this in place, that binary will default to the release browser
and it can be configured normally using:

    sudo update-alternatives --config brave-browser
@fmarier
Copy link
Member

fmarier commented Mar 26, 2019

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 brave/brave-core@c693f89) got merged.

@fmarier fmarier changed the title brave-browser launches the most recent install brave-browser launches the most recent install (.deb packages) Mar 27, 2019
fmarier added a commit to brave/brave-core that referenced this issue Mar 29, 2019
This fixes brave/brave-browser#1324 by ensuring that the release
package can also provide an alternative (of higher priority) for
the /usr/bin/brave-browser binary.

With this in place, that binary will default to the release browser
and it can be configured normally using:

    sudo update-alternatives --config brave-browser
@fmarier fmarier added this to the 0.65.x - Nightly milestone Apr 2, 2019
@Techguyprivate
Copy link

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
Copy link
Member

fmarier commented Apr 26, 2019

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 #1324 (comment).

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

@srirambv
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment