LoginSignup
0
1

More than 3 years have passed since last update.

システムワイドにLinuxbrewを導入する例

Posted at

rootではLinuxbrewをインストールできないが、かと言って個人ユーザーアカウントに紐づけたくはない。ということで、新たにlinuxbrewというLinuxbrew管理用ユーザーを作り、/home/linuxbrewにLinuxbrewをインストールしてみる。

インストール:

# as root
useradd linuxbrew -s /sbin/nologin -c 'Linuxbrew'
chmod 755 /home/linuxbrew
su -s /bin/bash linuxbrew
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
brew list

パスワードを聞かれるが、3回間違えて進めばよい。

2回目以降:

# as root
su -s /bin/bash linuxbrew
eval $(~/.linuxbrew/bin/brew shellenv)
brew list

各ユーザーの設定:

# users: add the following line to .bashrc
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)

本当に本当にシステムワイドでよいなら、/etc/profile.d以下に設定を置いてもよい。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1