さくらVPSのAlmaLinuxの標準インストールには git などの開発ツールが含まれていないのでインストールしました。
git や gcc、perl などを個別にインストールするのは面倒なので、dnf の「グループインストール」の機能を使います。
どんなグループがあるか確認します。
$ dnf grouplist
Available Environment Groups:
Server with GUI
Server
Minimal Install
Workstation
KDE Plasma Workspaces
Virtualization Host
Custom Operating System
Available Groups:
RPM Development Tools
.NET Development
Container Management
Console Internet Tools
Graphical Administration Tools
Scientific Support
Headless Management
Smart Card Support
Legacy UNIX Compatibility
Security Tools
Network Servers
System Tools
Development Tools
Fedora Packager
VideoLAN Client
Xfce
「Development Tools」の内容を確認します。
$ dnf groupinfo "Development Tools"
Group: Development Tools
Description: A basic development environment.
Mandatory Packages:
autoconf
automake
binutils
bison
flex
gcc
gcc-c++
gdb
glibc-devel
libtool
make
pkgconf
pkgconf-m4
pkgconf-pkg-config
redhat-rpm-config
rpm-build
rpm-sign
strace
Default Packages:
asciidoc
byacc
diffstat
git
intltool
jna
ltrace
patchutils
perl-Fedora-VSP
perl-generators
pesign
source-highlight
systemtap
valgrind
valgrind-devel
Optional Packages:
cmake
expect
rpmdevtools
rpmlint
インストールします。
$ sudo dnf groupinstall -y "Development Tools"
インストールされたバージョンを確認します。
$ git -v
git version 2.39.3
$ gcc --version
gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ perl -v
This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-thread-multi
(with 52 registered patches, see perl -V for more detail)
Copyright 1987-2021, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
「Development Tools」には node が含まれないので個別にインストールします。
$ sudo dnf install -y nodejs
node と npm がインストールされました。
$ node -v
v16.20.2
$ npm -v
8.19.4
npm は /usr/local
を更新するので、作業ユーザ(koba)が更新できるよう所有者を変更します。
$ sudo chown -R koba.koba /usr/local/
macOS と同様 に n で特定のバージョンをインストールできるようにします。
$ npm i -g n
安定版をインストールします。
$ n lts
v20.11.0 がインストールされました。
$ node -v
v20.11.0
もはや dnf でインストールした node は不要なので削除します。
$ sudo dnf remove nodejs