install:各種パッケージのインストール
各種パッケージのインストール
FreeBSD では、emacs, git, rsync, tmux, sudo などの OS が提供していないツールは「パッケージ」という仕組みでインストールします。
- パッケージはバイナリーで提供されています。
- ツールによってはパッケージが提供されていないので、その場合には「ports」という仕組みを使ってソースコードからコンパイルしてインストールします。
本ページでは「パッケージ」に関して簡単に説明します。
- パッケージ・ports に関しては、ハンドブックhttps://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.htmlに詳しい説明があります。
sudo コマンドのインストール
パッケージをインストールするには、root 権限で「pkg install パッケージ名」コマンドを実行します。
- root でログインするか、一般ユーザー権限でログインしている場合には、su コマンドを使用して root 権限を取得します。
- su コマンドを実行するとパスワードを聞かれるので、root のパスワードを入力します。
$ su
Password:
# pkg install sudo
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.15.10...
Extracting pkg-1.15.10: 100%
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100% 163 B 0.2kB/s 00:01
Fetching packagesite.txz: 100% 6 MiB 6.7MB/s 00:01
Processing entries: 100%
FreeBSD repository update completed. 31973 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 3 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
gettext-runtime: 0.21
indexinfo: 0.3.1
sudo: 1.9.3p1
Number of packages to be installed: 3
The process will require 5 MiB more space.
1 MiB to be downloaded.
Proceed with this action? [y/N]: y
[1/3] Fetching sudo-1.9.3p1.txz: 100% 925 KiB 947.4kB/s 00:01
[2/3] Fetching gettext-runtime-0.21.txz: 100% 165 KiB 168.9kB/s 00:01
[3/3] Fetching indexinfo-0.3.1.txz: 100% 6 KiB 5.8kB/s 00:01
Checking integrity... done (0 conflicting)
[1/3] Installing indexinfo-0.3.1...
[1/3] Extracting indexinfo-0.3.1: 100%
[2/3] Installing gettext-runtime-0.21...
[2/3] Extracting gettext-runtime-0.21: 100%
[3/3] Installing sudo-1.9.3p1...
[3/3] Extracting sudo-1.9.3p1: 100%
# visudo
上記の例では、sudo コマンドをインストールしてから、visudo コマンドを使用して sudo コマンドを実行するユーザーを登録する手順を想定しています。
sudo コマンドをインストールして sudo コマンドを実行するユーザーを登録しておくと、以降はそのユーザーの権限で「sudo 実行したいコマンドと引数」を実行して root 権限を必要とするコマンドを実行できます。
$ sudo pkg install tmux
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password:
ここでは、sudo コマンドを実行したユーザーのパスワードを入力します。
そのほかのコマンド
インストールされているパッケージの一覧を表示する。
$ pkg info
パッケージを検索する。
$ pkg search tmux py27-libtmux-0.8.3 Library for interfacing with tmux py27-tmuxp-1.5.5 Session manager for tmux py37-libtmux-0.8.3 Library for interfacing with tmux py37-tmuxp-1.5.5 Session manager for tmux rubygem-tmuxinator-2.0.1 Manage complex tmux sessions easily tmux-3.1b Terminal Multiplexer tmux-mem-cpu-load-3.4.0_4 CPU, RAM, and load monitor for use with tmux tmux23-2.3_1 Terminal Multiplexer (old stable version 2.3)
install/各種パッケージのインストール.txt · 最終更新: 2020/12/02 22:19 by asou
