初期設定 : モジュラーリポジトリを利用する2021/12/16 |
モジュラーリポジトリを利用する場合の基本操作です。
|
|
[1] | 利用可能なモジュールのリストを表示します。 |
[root@dlp ~]# dnf module list CentOS Stream 9 - AppStream Name Stream Profiles Summary maven 3.8 common [d] Java project management and project com prehension tool nginx 1.22 common [d] nginx webserver ..... ..... postgresql 15 client, server [d] PostgreSQL server and client module redis 7 common [d] Redis persistent key-value database ruby 3.1 common [d] An interpreter of object-oriented scrip ting language Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled |
[2] | 利用可能なモジュールをインストールするには以下のように設定します。 |
# 例として Node.js のモジュールリストを表示 [root@dlp ~]# dnf module list nodejs CentOS Stream 9 - AppStream Name Stream Profiles Summary nodejs 18 common [d], development, minimal, s2i Javascript runtime nodejs 20 common [d], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled # Node.js 18 をインストール [root@dlp ~]# dnf module -y install nodejs:18 Dependencies resolved. ======================================================================================== Package Arch Version Repo Size ======================================================================================== Installing group/module packages: nodejs x86_64 1:18.14.2-2.module_el9+307+7e5e4074 appstream 12 M npm x86_64 1:9.5.0-1.18.14.2.2.module_el9+307+7e5e4074 appstream 2.5 M Installing weak dependencies: nodejs-docs noarch 1:18.14.2-2.module_el9+307+7e5e4074 appstream 7.6 M nodejs-full-i18n x86_64 1:18.14.2-2.module_el9+307+7e5e4074 appstream 8.4 M Installing module profiles: nodejs/common Enabling module streams: nodejs 18 Transaction Summary ======================================================================================== Install 4 Packages ..... ..... # Node.js 18 が [e]nabled & [i]nstalled 状態となる [root@dlp ~]# dnf module list nodejs CentOS Stream 9 - AppStream Name Stream Profiles Summary nodejs 18 [e] common [d] [i], development, minimal, s2i Javascript runtime nodejs 20 common [d], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled[root@dlp ~]# node -v v18.14.2 |
[3] | インストール済みのモジュールを他バージョンに切り替えたい場合は以下のように設定します。 例として [2] でインストールした Node.js 18 を Node.js 20 に切り替えます。 |
[root@dlp ~]# dnf module list nodejs CentOS Stream 9 - AppStream Name Stream Profiles Summary nodejs 18 [e] common [d] [i], development, minimal, s2i Javascript runtime nodejs 20 common [d], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled # Node.js 20 をインストール [root@dlp ~]# dnf module -y install nodejs:20
Dependencies resolved. ======================================================================================= Package Arch Version Repo Size ======================================================================================= Upgrading: nodejs x86_64 1:20.5.1-1.module_el9+642+c81e94f6 appstream 14 M nodejs-docs noarch 1:20.5.1-1.module_el9+642+c81e94f6 appstream 8.0 M nodejs-full-i18n x86_64 1:20.5.1-1.module_el9+642+c81e94f6 appstream 8.5 M npm x86_64 1:9.8.0-1.20.5.1.1.module_el9+642+c81e94f6 appstream 2.6 M Installing module profiles: nodejs/common Enabling module streams: nodejs 20 Transaction Summary ======================================================================================= Upgrade 4 Packages ..... ..... # Node.js 20 が [e]nabled 状態になる [root@dlp ~]# dnf module list nodejs CentOS Stream 9 - AppStream Name Stream Profiles Summary nodejs 18 common [d], development, minimal, s2i Javascript runtime nodejs 20 [e] common [d] [i], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled[root@dlp ~]# node -v v20.5.1 |
Sponsored Link |