Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to completely uninstall brew and re-install brew in ubuntu 19.04

I installed homebrew on ubuntu 19.04 and it's accidentally stop, so the install not complete. but the folder already created.

If I install it again

sudo apt install linuxbrew-wrapper

I get a message:

linuxbrew-wrapper is already the newest version

but if I write command :

brew upgrade

I get this message:

Command 'brew' not found, but can be installed with:

sudo apt install linuxbrew-wrapper".

Can anyone help me fix this?

like image 276
walid thalib Avatar asked Jul 25 '19 18:07

walid thalib


5 Answers

Maybe this can help more people...

I just executed the following command line

$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

This is the same url as in here Homebrew homepage but instead of install.sh, I used uninstall.sh.

homebrew uninstall

like image 184
mlecar Avatar answered Oct 19 '22 18:10

mlecar


After performing what https://stackoverflow.com/a/57208010/2787992 said, you might need to run

sudo rm -rf /home/linuxbrew
like image 38
iChux Avatar answered Oct 19 '22 19:10

iChux


/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

sudo rm -rf /home/linuxbrew

For details see: https://www.how2shout.com/linux/how-to-install-brew-ubuntu-20-04-lts-linux/

like image 8
maestrom4 Avatar answered Oct 19 '22 18:10

maestrom4


Try performing this command first And let me know brew works after performing it

source ~/.bashrc 

like image 4
Kathan Tripathi Avatar answered Oct 19 '22 18:10

Kathan Tripathi


Try uninstalling the packages.

To remove just linuxbrew-wrapper package

sudo apt-get remove linuxbrew-wrapper

If you want to delete configuration and data files

sudo apt-get purge linuxbrew-wrapper
like image 4
Manuja Jayawardana Avatar answered Oct 19 '22 19:10

Manuja Jayawardana