chromebrew / chromebrew

Package manager for Chrome OS
https://chromebrew.github.io
GNU General Public License v3.0
2.33k stars 377 forks source link

Uninstall script? #429

Closed jackmerrill closed 6 years ago

jackmerrill commented 7 years ago

Is there a way to make a script for ChromeBrew that uninstalls crew? I looked at the issue from 3 years ago, but I wouldn't really know how.

cstrouse commented 7 years ago

@yoshifan509 you can either remove everything under /usr/local or if you don't like that idea you can concatenate all of the filelists under /usr/local/etc/crew/meta and remove all of those files plus the ones that install.sh creates.

jam7 commented 7 years ago

How about this script?

#!/bin/bash
for i in `crew search|grep '(i)'|grep -v ruby|sed -e 's/(i) *//'`; do
  sudo crew remove $i
done
sudo crew remove ruby

If we have this script as uninstall.sh next to install.sh, we can perform wget -O - ...uninstall.sh | bash

This script doesn't work correctly if a user install several ruby like ruby and ruby3.

dragon788 commented 7 years ago

Is there a reason other than that Homebrew does it that Chromebrew puts everything in /usr/local instead of in the user's home directory? Doing it in the home directory may be slightly safer to "clean", though on a multi-user system it would result in a bit of wasted space if multiple users had their own installs.

I believe Linuxbrew either defaults to the user's home directory (to avoid permissions issues with /usr/local) or can be set to a custom prefix.

jam7 commented 7 years ago

Any files under user's home directory are not exacutable in chromebook environment. Therefore, we don't use home directory.

It is possible to use /usr/local/.local or something instead like @cstrouse said in #536.

uberhacker commented 7 years ago

See #877.

dragon788 commented 7 years ago

If you really want to "uninstall" and you don't have Linuxbrew or anything else in /usr/local you can use dev_install --uninstall which will automatically wipe any non-hidden folders from /usr/local. After discovering it in the comments in an issue on this repo I've been using it to recover from any shenanigans that break my Chromebrew/Linuxbrew installs.

uberhacker commented 7 years ago

@dragon788: I have never used dev_install. Can you specify a directory other than /usr/local to uninstall? Since we have the #{CREW_PREFIX} constant, we could override the /usr/local default directory.

jackmerrill commented 7 years ago

fuck you all bitches.....

uberhacker commented 7 years ago

And your point is?