Bazel: how to uninstall bazel, if had install bazel like (without --user) "sudo bash bazel-0.1.4-installer-linux-x86_64.sh "

Created on 23 Feb 2016  Â·  14Comments  Â·  Source: bazelbuild/bazel

P3 team-XProduct documentation (cleanup)

Most helpful comment

so ugly.

All 14 comments

Be careful when executing the command as mistyped can lead to catastrophic issues:

rm $HOME/.cache/bazel -fr
sudo rm /usr/local/bin/bazel /etc/bazelrc /usr/local/lib/bazel -fr

I am not sure we should document it that way but maybe we should add a --uninstall option to the installer (not sure either). These stuff are kind of dangerous.

thanks

Let's keep this open until we actually figure out how to correctly do it.

@damienmg After

rm $HOME/.cache/bazel -fr
sudo rm /usr/local/bin/bazel /etc/bazelrc /usr/local/lib/bazel -fr
~/.cache/bazel

I can still run the cmdbazel version. Why?? Didn't remove completely?

Find the bazel install by running:
find / -name "Bazel"

This will return the path to the bin file of bazel like: /user/bin/bazel.

Be careful in this step and only do if you know what you are doing:
rm -rf /user/bin/bazel

so ugly.

I use ubuntu16.04
maybe you can do this:

which bazel

then it will return bazel's directory,do this:

sudo rm -rf your-directory

@yellowyellowyao please do not do that, you might end up removing other unrelated files in that directory. If it's an important directory like /usr/local/bin, you may end up removing binaries your system depends on.

@aiuto I'm marking this as a p2 because it'll be great to have a better set of instructions on uninstallation.

such an ugly way to uninstall

sudo apt-get --purge remove bazel - Worked like a charm. Needed to revert from 0.28 to 0.26. Hope this helps someone else!

You can use bazelisk (https://github.com/bazelbuild/bazelisk) to switch your Bazel version on the fly, without having to work with system installations.

On Aug 22, 2019, at 9:22 AM, eanmikale notifications@github.com wrote:

sudo apt-get --purge remove bazel - Worked like a charm. Needed to revert from 0.28 to 0.26. Hope this helps someone else!

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

maybe we should add a --uninstall option to the installer

This makes the most sense. I was surprised that the script didn't have this option.

Was this page helpful?
0 / 5 - 0 ratings