installing linux brew fails due to permissions
(note, i tried to add this issue to the linux brew installer repo but there didnt seem to be an issues page). I recently purchased a machine with the newest stable version of Debian. On My other machine (that runs ubuntu) i successfully installed linuxbrew using the shell command provided in the 'readme.md' file (Linux brew installer repo) . However on the machine with debian, it refuses to install citing permission denied errors and it fails at : git init -q. Usually this could be solved by using sudo or su, but The installation script refuses to be installed by root. Thanks in advance (and i sincerely apologize if this was the wrong place to add my issue, but the install page does not have an issues section)
I'm facing the same problem. I made a new directory but it is not helping
Could you please report the exact error message that you're seeing, copied and pasted from the terminal? Please include the complete output.
$sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
==> Select the Linuxbrew installation directory
- Enter your password to install to /home/linuxbrew/.linuxbrew (recommended)
- Press Control-D to install to /home/work/.linuxbrew
- Press Control-C to cancel installation
[sudo] password for work:
Sorry, try again.
[sudo] password for work:
==> This script will install:
/home/linuxbrew/.linuxbrew/bin/brew
/home/linuxbrew/.linuxbrew/share/doc/homebrew
/home/linuxbrew/.linuxbrew/share/man/man1/brew.1
/home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew
/home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew
/home/work/.cache/Homebrew/
/home/linuxbrew/.linuxbrew/Homebrew
==> The following new directories will be created:
/home/linuxbrew/.linuxbrew/Cellar
/home/linuxbrew/.linuxbrew/bin
/home/linuxbrew/.linuxbrew/etc
/home/linuxbrew/.linuxbrew/include
/home/linuxbrew/.linuxbrew/lib
/home/linuxbrew/.linuxbrew/opt
/home/linuxbrew/.linuxbrew/sbin
/home/linuxbrew/.linuxbrew/share
/home/linuxbrew/.linuxbrew/share/zsh
/home/linuxbrew/.linuxbrew/share/zsh/site-functions
/home/linuxbrew/.linuxbrew/var
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var
==> /usr/bin/sudo /bin/chmod g+rwx /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var
==> /usr/bin/sudo /bin/chmod 755 /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions
==> /usr/bin/sudo /bin/chown work /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var
==> /usr/bin/sudo /bin/chgrp work /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var
==> /usr/bin/sudo /bin/mkdir -p /home/work/.cache/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /home/work/.cache/Homebrew
==> /usr/bin/sudo /bin/chown work /home/work/.cache/Homebrew
==> /usr/bin/sudo /bin/chgrp work /home/work/.cache/Homebrew
==> Downloading and installing Linuxbrew...
/home/linuxbrew/.linuxbrew/Homebrew/.git: Permission denied
Failed during: git init -q
https://github.com/Linuxbrew/install/blob/56013c38f693f28d9df83d453511a90bcc1e7be4/install#L360
Please report…
id
ls -ld /home
ls -ld /home/linuxbrew
ls -ld /home/linuxbrew/.linuxbrew
ls -ld /home/linuxbrew/.linuxbrew/Homebrew
ls -ld /home/linuxbrew/.linuxbrew/Homebrew/.git
[work@xxx default]$id
uid=1000(work) gid=1000(work) groups=1000(work)
[work@xxx default]$ls -ld /home
drwxr-xr-x. 4 root root 35 Jan 11 16:25 /home
[work@xxx default]$ls -ld /home/linuxbrew
drwxr-xr-x 3 root root 24 Jan 11 16:25 /home/linuxbrew
[work@xxx default]$ls -ld /home/linuxbrew/.linuxbrew
drwxr-xr-x 12 root root 131 Jan 11 16:27 /home/linuxbrew/.linuxbrew
[work@xxx default]$ls -ld /home/linuxbrew/.linuxbrew/Homebrew
drwxr-xr-x 3 root root 21 Jan 11 16:25 /home/linuxbrew/.linuxbrew/Homebrew
[work@xxx default]$ls -ld /home/linuxbrew/.linuxbrew/Homebrew/.git
ls: cannot access /home/linuxbrew/.linuxbrew/Homebrew/.git: No such file or directory
I've merged PR https://github.com/Linuxbrew/install/pull/22, which should hopefully resolve your issue. It was caused by having an existing /home/linuxbrew/.linuxbrew/Homebrew directory that is not owned by you. Thanks for the bug report!
I am facing same issue. `$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" ==> This script will install: /home/linuxbrew/.linuxbrew/bin/brew /home/linuxbrew/.linuxbrew/share/doc/homebrew /home/linuxbrew/.linuxbrew/share/man/man1/brew.1 /home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew /home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew /homes/vintim/.cache/Homebrew/ /home/linuxbrew/.linuxbrew/Homebrew
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /homes/vintim/.cache/Homebrew
/bin/mkdir: cannot create directory /homes/vintim/.cache/Homebrew': Permission denied
Please enclose copy-and-paste blocks in triple back ticks. See https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code
Try…
sudo chown -R vintim: /homes/vintim/.cache/Homebrew