1

I have to reinstall every program every time I disconnect from SSH. Can someone please explain to me what I'm doing wrong? New to Linux, if you could explain in small words it'd be a huge help.

I input these lines into the terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
brew update

Log out of server and back in, same terminal session

brew update

And I get the error: Command 'brew' not found

Here's the full terminal session:

user@laptop:~$ ssh -p port# user@ServerAddress
user@ServerAddress's password: 
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-37-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon 15 Jun 2020 03:04:03 AM UTC

  System load:  0.02               Temperature:           60.0 C
  Usage of /:   3.7% of 195.13GB   Processes:             196
  Memory usage: 2%                 Users logged in:       1
  Swap usage:   0%                 IPv4 address for eno1: ServerAddress

 * MicroK8s gets a native Windows installer and command-line integration.

     https://ubuntu.com/blog/microk8s-installers-windows-and-macos

0 updates can be installed immediately.
0 of these updates are security updates.


Last login: Mon Jun 15 02:18:15 2020 from Address
user@server:~$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/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
/home/linuxbrew/.linuxbrew/Homebrew
==> The following existing directories will be made writable by user only:
/home/linuxbrew/.linuxbrew/share/zsh
/home/linuxbrew/.linuxbrew/share/zsh/site-functions

Press RETURN to continue or any other key to abort
[sudo] password for user: 
==> /usr/bin/sudo /bin/chmod u+rwx /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions
==> /usr/bin/sudo /bin/chmod 755 /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions
==> Downloading and installing Homebrew...
HEAD is now at 0125c4cd5 Merge pull request #7740 from vidusheeamoli/add-tapioca
Already up-to-date.
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
- Install the Homebrew dependencies if you have sudo access:
  Debian, Ubuntu, etc.
    sudo apt-get install build-essential
  Fedora, Red Hat, CentOS, etc.
    sudo yum groupinstall 'Development Tools'
  See https://docs.brew.sh/linux for more information.
- Configure Homebrew in your /home/user/.profile by running
    echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> /home/user/.profile
- Add Homebrew to your PATH
    eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
- We recommend that you install GCC by running:
    brew install gcc

user@server:~$ eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
user@server:~$ brew update
Already up-to-date.
user@server:~$ exit
logout
Connection to ServerAddress closed.
user@laptop:~$ ssh -p port# user@ServerAddress
user@ServerAddress's password: 
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-37-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon 15 Jun 2020 03:12:51 AM UTC

  System load:  0.05               Temperature:           57.0 C
  Usage of /:   3.7% of 195.13GB   Processes:             191
  Memory usage: 2%                 Users logged in:       1
  Swap usage:   0%                 IPv4 address for eno1: ServerAddress

 * MicroK8s gets a native Windows installer and command-line integration.

     https://ubuntu.com/blog/microk8s-installers-windows-and-macos

0 updates can be installed immediately.
0 of these updates are security updates.


Last login: Mon Jun 15 03:04:03 2020 from Address
user@server:~$ brew update

Command 'brew' not found, did you mean:

  command 'brec' from deb bplay (0.991-10build1)
  command 'qbrew' from deb qbrew (0.4.1-8build1)

Try: sudo apt install <deb name>

user@server:~$ 

Random facts that may be relevant:

  • 3rd install of Ubuntu 20.04 LTS, same problem on each (took me a few to isolate this issue)
  • Only openSSH is selected to be installed during OS installation process

Thanks for reading.

2
  • The location /home/linuxbrew/.linuxbrew is not a normal location that your system know to look for an application. Also, be aware that linuxbrew software won't be found by apt, snap, pip, or other common package managers on an Ubuntu system.
    – user535733
    Jun 15, 2020 at 3:45
  • Thank you so much for the warning, I have no familiarity for the directory on Linux, and I often end up with strange paths. I don't intend on using linuxbrew software beyond this single instance so, hopefully it won't be an issue. Jun 15, 2020 at 3:51

1 Answer 1

3

This command eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) must be add into you file .bashrc at the end .

By adding this command , it will modify you PATH variable .

So after the command brew will be available .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .