Original link: http://ponder.work/2023/05/28/homebrew-as-non-root-package-manager/
For maintenance and security reasons, some public Linux servers generally only provide users with normal privileges.
The permissions of ordinary users are enough for daily use, but it is difficult to configure your own development environment and install some packages you need.
If you compile and install software from source code, the maintenance of dependencies is too complicated, and the version of the initial compilation tool chain may not meet the requirements, such as the version of gcc is too low.
If you apply for sudo permission or request to update the system or install docker, it will be difficult to define the responsibilities later, and the operation and maintenance and administrators will generally not agree.
Therefore, the optimal solution is for users who need to maintain their own tool chain and environment in their personal directory. The solution below is built around HomeBrew.
Install miniconda to resolve pre-dependencies
If your system is relatively new, you can try安装HomeBrew
directly.
Based on the content discussed above, public servers generally have the problem of low system version, it is not uncommon for centos7 or centos6, and the version of libraries such as glibc is also very low.
Installing HomeBrew has two strong dependencies, git and curl, and the versions of the dependencies are relatively high, and the version of centos7 cannot be satisfied.
In addition, since many Brew software needs to be compiled from source code, gcc and a good network environment are also indispensable.
Fortunately, miniconda can solve the above problems. miniconda only provides dependencies for HomeBrew installation, which can be deleted later.
Configure conda source (optional): Create a new .condarc
with the following content
1 |
channels : |
Download and install miniconda
1 |
# download |
Configure installation environment variables
These environment variables can also be configured in files such as bashrc to make them permanent
1 |
# Set up curl and git, optional |
Install HomeBrew
HomeBrew needs to be installed manually since you don’t have root privileges.
Since it is a manual installation, the location is different from the default installation location, and many precompiled packages cannot be used, and must be compiled from source code, so network and machine performance and patience are very important.
1 |
# Download, you can also use Tsinghua source https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git |
refer to
- https://docs.brew.sh/Installation
- https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
- https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
- https://github.com/tuna/issues/issues/1353
This article is transferred from: http://ponder.work/2023/05/28/homebrew-as-non-root-package-manager/
This site is only for collection, and the copyright belongs to the original author.