Linuxbrew 从头开始​​,没有 /usr/bin,只有 userhome/usr/bin

Linuxbrew 从头开始​​,没有 /usr/bin,只有 userhome/usr/bin

我正在尝试为普通用户安装 linuxbrew。我已经最小限度安装了 Oracle Linux 7.7,并放入了一个没有 root 权限的用户 test。我已经在用户 test 下逐步编译并安装了 Linuxbrew 所需的所有软件包。现在问题是在用户 test 下,所有库和包(如 git)都在 /home/test/usr/{bin、lib、lib64、include 等} 中,但 brew 不知道安装了 git 或 curl。bashrc 中的路径是正确的,所以我认为这些是 ENV:

[测试@测试〜] $ curl〜
/ usr / bin / curl

[测试@测试〜] $哪个git〜
/ usr / bin / git

[测试@测试〜] $ env

    CPLUS_INCLUDE_PATH=/home/test/usr/include
    XDG_SESSION_ID=24
    HOSTNAME=testing
    SELINUX_ROLE_REQUESTED=
    TERM=xterm
    SHELL=/bin/bash
    HISTSIZE=1000
    SSH_CLIENT=192.168.0.234 64558 22
    SELINUX_USE_CURRENT_RANGE=
    SSH_TTY=/dev/pts/0
    USER=test
    LD_LIBRARY_PATH=/home/test/usr/lib:/home/test/usr/lib64
    PATH=/home/test/localperl/bin:/home/test/usr/bin:/home/test/usr/libexec:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/test/.local/bin:/home/test/bin
    C_INCLUDE_PATH=/home/test/usr/include
    PWD=/home/test
    LANG=en_US.UTF-8
    SELINUX_LEVEL_REQUESTED=
    HISTCONTROL=ignoredups
    SHLVL=1
    HOME=/home/test
    LOGNAME=test
    SSH_CONNECTION=192.168.0.234 64558 192.168.0.200 22
    PKG_CONFIG_PATH=/home/test/usr/lib/pkgconfig:/home/test/usr/lib64/pkgconfig
    LESSOPEN=||/usr/bin/lesspipe.sh %s
    XDG_RUNTIME_DIR=/run/user/1001
    _=/usr/bin/env

[测试@测试〜] $ cat .bashrc

如果 [ -f /etc/bashrc ]; 那么

    . /etc/bashrc

    export PATH=$HOME/localperl/bin:$HOME/usr/bin:$HOME/usr/libexec:$PATH
    export LD_LIBRARY_PATH=$HOME/usr/lib:$HOME/usr/lib64
    export C_INCLUDE_PATH=$HOME/usr/include
    export CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH
    export PKG_CONFIG_PATH=$HOME/usr/lib/pkgconfig:$HOME/usr/lib64/pkgconfig

[测试@测试〜] $ brew config

    HOMEBREW_VERSION: >=2.2.0 (shallow or no git repository)
    ORIGIN: (none)
    HEAD: (none)
    Last commit: never
    Core tap: N/A
    HOMEBREW_PREFIX: /home/test/usr
    HOMEBREW_REPOSITORY: /home/test/.linuxbrew/Homebrew
    HOMEBREW_CELLAR: /home/test/usr/Cellar
    HOMEBREW_CASK_OPTS: []
    HOMEBREW_MAKE_JOBS: 1
    CPU: single-core 64-bit sandybridge
    Homebrew Ruby: 2.6.3 => /home/test/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
    Clang: N/A
    Git: N/A
    Curl: 7.29.0 => /usr/bin/curl
    Kernel: Linux 4.14.35-1902.3.2.el7uek.x86_64 x86_64 GNU/Linux
    OS: Red Hat Enterprise Linux Server release 7.7 (Maipo)
    Host glibc: 2.17
    /usr/bin/gcc: 4.8.5
    glibc: N/A
    gcc: N/A
    xorg: N/A

[测试@测试〜] $ brew doctor

    Please note that these warnings are just used to help the Homebrew maintainers
    with debugging if you file an issue. If everything you use Homebrew for is
    working fine: please don't worry or file an issue; just ignore this. Thanks!

    Warning: Git could not be found in your PATH.
    Homebrew uses Git for several internal functions, and some formulae use Git
    checkouts instead of stable tarballs. You may want to install Git:
      brew install git
    Error: Git is unavailable
    Error: Failure while executing; `/home/test/usr/bin/brew tap homebrew/core` exited with 1.

答案1

我通过将 .linuxbrew/Homebrew 目录移动到 ~/usr 解决了 Git 的问题,然后:

    ln -s ~/usr/Homebrew/bin/brew ~/usr/bin
    eval $ (~/usr/bin/brew shellenv)

现在 brew 知道 git 在哪里

    Git: 2.28.0 => /home/test/usr/bin/git

但他仍然在寻找卷曲

    curl: 7.29.0 => /usr/bin/curl

相关内容