目的
almalinuxを用いるとき、パッケージ管理ソフトはyumかdnfを用いると思う。今回はdnfを用いた時に特定のバージョンのパッケージをインストールする方法を解説する。
想定
phpをインストールする時はdefaultでversion7.2がインストールされてしまう。この時、8.0をインストールしたい。
確認
まずは、インストール出来るパッケージのリストを確認する。
dnf module list php
AlmaLinux 8 - AppStream
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 common [d], devel, minimal PHP scripting language
php 8.0
[d]が付いている所は、defaultでインストールされる。
設定
以下の設定をいれる
dnf -y module reset php && dnf -y module enable php:8.0
インストール
dnf -y install php