Команда 'abc' не найдена ... Каждая установленная команда каждый раз, когда я SSH на сервер

Мне приходится переустанавливать каждую программу каждый раз, когда я отключаюсь от SSH. Может кто-нибудь объяснить мне, что я делаю не так? Впервые в Linux, если бы вы могли объяснить короткими словами, это было бы очень полезно.

Я ввел эти строки в терминал:

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

Выйдите из сервера и снова войдите в ту же сессию терминала

brew update

И я получаю ошибка: команда 'brew' не найдена

Вот полный сеанс терминала:

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:~$ 

Случайные факты, которые могут иметь значение:

  • 3-я установка Ubuntu 20.04 LTS, та же проблема на каждом (мне понадобилось несколько, чтобы изолировать это проблема)
  • Только openSSH выбран для установки в процессе установки ОС

Спасибо за чтение.

1
задан 15 June 2020 в 06:23

1 ответ

This command eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) необходимо добавить в файл .bashrc в конце.

Добавив эту команду, вы измените переменную PATH.

Так что после команды brew будет доступен .

1
ответ дан 19 June 2020 в 21:24

Другие вопросы по тегам:

Похожие вопросы: