orca icon indicating copy to clipboard operation
orca copied to clipboard

brew install ... doesn't work (Martin's class)

Open tmozgach opened this issue 8 years ago • 0 comments

Temporary solution:

First create this directory:

mkdir -p -m775 ~/.cache/Homebrew

Then create a .bashrc (dot bashrc) file in their home directory. To do this, you can copy the code between the dotted line. And paste into the terminal:

echo '# .bashrc
 
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
 
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
 
# User specific aliases and functions
alias brew='sudo -u linuxbrew HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew'
' >> ~/.bashrc

Then log out and log back in for it to take effect.

Now brew install nano will work for example

Possible permanent solution for future (Hackseq?):

  1. mount the file .bashrc in read-only mode ( docker run -v ....:ro )
  2. run container in the backround mode (docker run -d ...)
  3. execute a container and pass the command mkdir -p -m775 ~/.cache/Homebrew ( docker exec -it -u $(id -u):$(id -g) <<<CONTAINER_ID>>> /bin/bash -c "mkdir -p -m775 ~/.cache/Homebrew && /bin/bash”)

tmozgach avatar Sep 14 '17 21:09 tmozgach