orca
orca copied to clipboard
brew install ... doesn't work (Martin's class)
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?):
- mount the file .bashrc in read-only mode (
docker run -v ....:ro) - run container in the backround mode (
docker run -d ...) - 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”)