これまで、Fedora が先行的なパッケージを取り込み、安定したものを RHEL として有償サポート付きでリリースし、それを無償化&無サポート化したものが CentOS という位置づけでしたが、2021年末からは、CentOS は CentOS Stream に名前を変え、RHEL の開発バージョン、つまり、Fedora と RHEL の中間的な存在に変わることが発表されました。また、これまでの CentOS の位置づけを後継するプロジェクトとして Rocky Linux が発表されました。
Before:Fedora →(安定版)→ Red Hat Enterprise Linux → (無償化)→ CentOS After: Fedora →(開発版)→ CentOS Stream →(安定版) Red Hat Enterprise Linux → (無償化)→ Rocky Linux
CentOS 7 と CentOS 8 では下記などのバージョンが変わっています。CentOS 7 で * がついているものは、標準パッケージではなく EPEL による提供でした。
Linux Kernel 3.10 → 4.18 Python 2.7 → 3.6 PHP 5.4 → 7.2 Perl 5.16 → 5.26 Ruby 2.0 → 2.5 Node.js 6.17 * → 10.21 MariaDB 5.5 → 10.3 PostgreSQL 9.2 → 10.14 Redis 3.2 * → 5.0 git 1.8 → 2.27 gcc 4.8 → 8.3 httpd 2.4 → 2.4 Nginx 1.16 * → 1.14
パッケージ管理システムが yum から dnf に変更となりました。DaNdiFied yum (ダンディなYum) という意味だそうです。yum は Python 2 ベースでしたが、Python 3 ベースで書き直されたものが dnf です。コマンド名は変わりましたが、オプションや利用方法はあまり変わりません。yum コマンドは dnf にシンボリックリンクされているので、yum コマンドも利用できます。
CentOS7# yum -y install httpd CentOS8# dnf -y install httpd
CentOS 7 の Python は 2.7 でしたが、CentOS 8 では、4つのバージョンの Python が存在します。platform-python は必須パッケージとしてインストールされています。必要に応じて、python2, python36, python38 を追加インストールします。
パッケージ | パス | 説明 |
---|---|---|
platform-python | /usr/libexec/platform-python | システムが使用するPython (3.6) |
python2 | /usr/bin/python2 /usr/bin/python2.7 | Python 2.7 |
python36 | /usr/bin/python3 /usr/bin/python3.6 | Python 3.6 (標準) |
python38 | /usr/bin/python3.8 | Python 3.8 |
標準では /usr/bin/python は存在しません。alternatives コマンドで、/usr/bin/python を python2 または python3(3.6) または python3.8 のシンボリックリンクとして作成することができます。
# alternatives --config python There are 4 programs which provide 'python'. Selection Command ----------------------------------------------- *+ 1 /usr/libexec/no-python 2 /usr/bin/python2 3 /usr/bin/python3 4 /usr/bin/python3.8 Enter to keep the current selection[+], or type selection number: 3
日本語を使用できるようにするためには下記のパッケージをインストールする必要があります。
# dnf -y install glibc-langpack-ja
コマンドの実行結果を日本語で表示するにはさらに下記の環境変数を設定します。
export LANG=ja_JP.UTF-8
パケットフィルタ機能が iptables から nftables に変わりました。
# dnf -y install nftables # systemctl start nftables # nft list ruleset
CentOS 7 から NTP は ntpd ではなく chronyd に変わりました。
# yum -y install chrony # vi /etc/chrony.conf server 0.centos.pool.ntp.org iburst server 1.centos.pool.ntp.org iburst server 2.centos.pool.ntp.org iburst server 3.centos.pool.ntp.org iburst (以下略) # systemctl restart chronyd
iptables が nftables に変わった影響もあり、CentOS 8 での Docker CE はまだ安定していないようです。代わりに、Red Hat が CentOS 7.6 以降で Docker の後継として開発した Podman が利用できます。Docker とほぼ同等の機能を備えており、かつ、デーモンが不要(Dockerデーモンダウンで全コンテナがダウンすることが無い)、一般ユーザーでも利用できる、複数のコンテナを Pod として管理する機能が追加されているなどの利点を持ちます。podman-docker をインストールすることで、docker 互換コマンドをインストールすることもできます。
# dnf -y install podman-docker # docker run -d -it --name centos8 -h centos8 centos:8
コンテナ内で Ctrl-p がシェルのヒストリとコンテナのデタッチでバッティングしてしまう場合は、下記の設定を行いますが何故か効かない。バグかな... #4651。
$ vi ~/.config/containers/containers.conf [engine] detach_keys="ctrl-\\"
-v で volume をマウントしても Permission denied で書き込みができない場合は、ホスト側で、対象ディレクトリに container_file_t コンテキストを設定してください。
# chcon -R -h -t container_file_t /foo/baa/target_dir
Docker が対応していて、Podman が対応していないのは下記のコマンドだそうです。network は別のアプローチがあるのかな。rename は本当になくて、コンテナの作り直しが必要だそうです。
network node plugin rename secret service stack swarm
TLS 1.0 と TLS 1.1 がデフォルトで廃止されました。どうしても TLS 1.0 や 1.1 を有効にしたい時は下記のコマンドを実行します。
# update-crypto-policies --show DEFAULT # sudo update-crypto-policies --set LEGACY # update-crypto-policies --show LEGACY
CentOS8 にログインすると下記の様なメッセージが表示されることがあります。
Activate the web console with: systemctl enable --now cockpit.socket
CentoS 8 からは cockpit というWeb管理画面機能が標準装備されていて、それを有効化しろとのメッセージです。使用する場合は systemctl で有効化。使用しない場合は削除しても問題ありません。
# 使用する場合 # systemctl enable --now cockpit.socket # 使用しない場合 # systemctl stop cockpit.socket # dnf -y remove cockpit