This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

'sweep' command installs itself into /usr/local and changes permissions, wreaking havoc on Homebrew

Sophos installs a sweep command into /usr/local/bin, and a few auxiliary files. Doing this, Sophos also changes ownership of /usr/local and several sub-directories. This wreaks havoc with Howebrew, which by default installs to /usr/local and expects it to be writable by the "main user". In general, /usr/local should not be used by non-user controlled installations.

A more polite way would be for Sophos to install its commands to /opt/sophos, and asking the user to and relevant paths if they wish to use the tools.



This thread was automatically locked due to age.
Parents
  • Here is a bit of a workaround... Add this function to your ~/.bash_profile

    # Freshen up your brew.
    freshbrew() {
      me="$(whoami)"

      file1="$(stat /usr/local/bin | awk '{ print $5 }')"
      file2="$(stat /usr/local/share | awk '{ print $5 }')"

      if [ "$me" != "$file1" ]; then
        echo -e "Need to chown /usr/local/bin"
        sudo chown -R $(whoami):admin /usr/local/bin
      fi

      if [ "$me" != "$file2" ]; then
        echo -e "Need to chown /usr/local/share"
        sudo chown -R $(whoami):admin /usr/local/share
      fi

      brew doctor
      brew update
      brew upgrade
      brew cleanup
      brew prune
    }



    Source your bash_profile and then run it by typing freshbrew at the command prompt. If you need to chown, you'll be asked for your password. Otherwise, you won't and you'll be able to brew like normal.

Reply
  • Here is a bit of a workaround... Add this function to your ~/.bash_profile

    # Freshen up your brew.
    freshbrew() {
      me="$(whoami)"

      file1="$(stat /usr/local/bin | awk '{ print $5 }')"
      file2="$(stat /usr/local/share | awk '{ print $5 }')"

      if [ "$me" != "$file1" ]; then
        echo -e "Need to chown /usr/local/bin"
        sudo chown -R $(whoami):admin /usr/local/bin
      fi

      if [ "$me" != "$file2" ]; then
        echo -e "Need to chown /usr/local/share"
        sudo chown -R $(whoami):admin /usr/local/share
      fi

      brew doctor
      brew update
      brew upgrade
      brew cleanup
      brew prune
    }



    Source your bash_profile and then run it by typing freshbrew at the command prompt. If you need to chown, you'll be asked for your password. Otherwise, you won't and you'll be able to brew like normal.

Children