Gitをインストールする!(Rocky Linux 9)

Rocky Linux 9にGitをインストールします。

インストール環境を確認する!

インストール環境を確認します。

$ hostnamectl
 Static hostname: vmsaws01.loc.lab4ict.com
       Icon name: computer-vm
         Chassis: vm
      Machine ID: c5cfb03d2529409da1a18560f71e844a
         Boot ID: 52f29b62921c421da9a47e4ec825f166
  Virtualization: oracle
Operating System: Rocky Linux 9.1 (Blue Onyx)      
     CPE OS Name: cpe:/o:rocky:rocky:9::baseos
          Kernel: Linux 5.14.0-162.6.1.el9_1.x86_64
    Architecture: x86-64
 Hardware Vendor: innotek GmbH
  Hardware Model: VirtualBox

Gitをデフォルトのリポジトリからインストールする!

Gitをデフォルトリポジトリからインストールします。

$ sudo dnf install git
...
========================================================================================================================
 Package                             Architecture        Version                           Repository              Size
========================================================================================================================
Installing:
 git                                 x86_64              2.39.3-1.el9_2                    appstream               61 k
Installing dependencies:
 git-core                            x86_64              2.39.3-1.el9_2                    appstream              4.2 M
 git-core-doc                        noarch              2.39.3-1.el9_2                    appstream              2.6 M
 perl-AutoLoader                     noarch              5.74-480.el9                      appstream               21 k
 perl-B                              x86_64              1.80-480.el9                      appstream              179 k
 perl-Carp                           noarch              1.50-460.el9                      appstream               29 k
 perl-Class-Struct                   noarch              0.66-480.el9                      appstream               22 k
 perl-Data-Dumper                    x86_64              2.174-462.el9                     appstream               55 k
 perl-Digest                         noarch              1.19-4.el9                        appstream               25 k
 perl-Digest-MD5                     x86_64              2.58-4.el9                        appstream               36 k
 perl-DynaLoader                     x86_64              1.47-480.el9                      appstream               26 k
 perl-Encode                         x86_64              4:3.08-462.el9                    appstream              1.7 M
 perl-Errno                          x86_64              1.30-480.el9                      appstream               15 k
 perl-Error                          noarch              1:0.17029-7.el9                   appstream               41 k
 perl-Exporter                       noarch              5.74-461.el9                      appstream               31 k
 perl-Fcntl                          x86_64              1.13-480.el9                      appstream               20 k
 perl-File-Basename                  noarch              2.85-480.el9                      appstream               17 k
 perl-File-Find                      noarch              1.37-480.el9                      appstream               26 k
 perl-File-Path                      noarch              2.18-4.el9                        appstream               35 k
 perl-File-Temp                      noarch              1:0.231.100-4.el9                 appstream               59 k
 perl-File-stat                      noarch              1.09-480.el9                      appstream               17 k
 perl-FileHandle                     noarch              2.03-480.el9                      appstream               16 k
 perl-Getopt-Long                    noarch              1:2.52-4.el9                      appstream               60 k
 perl-Getopt-Std                     noarch              1.12-480.el9                      appstream               16 k
 perl-Git                            noarch              2.39.3-1.el9_2                    appstream               37 k
 perl-HTTP-Tiny                      noarch              0.076-460.el9                     appstream               54 k
 perl-IO                             x86_64              1.43-480.el9                      appstream               87 k
 perl-IO-Socket-IP                   noarch              0.41-5.el9                        appstream               42 k
 perl-IPC-Open3                      noarch              1.21-480.el9                      appstream               23 k
 perl-MIME-Base64                    x86_64              3.16-4.el9                        appstream               30 k
 perl-Net-SSLeay                     x86_64              1.92-2.el9                        appstream              365 k
 perl-POSIX                          x86_64              1.94-480.el9                      appstream               96 k
 perl-PathTools                      x86_64              3.78-461.el9                      appstream               85 k
 perl-Pod-Escapes                    noarch              1:1.07-460.el9                    appstream               20 k
 perl-Pod-Perldoc                    noarch              3.28.01-461.el9                   appstream               83 k
 perl-Pod-Simple                     noarch              1:3.42-4.el9                      appstream              215 k
 perl-Pod-Usage                      noarch              4:2.01-4.el9                      appstream               40 k
 perl-Scalar-List-Utils              x86_64              4:1.56-461.el9                    appstream               71 k
 perl-SelectSaver                    noarch              1.02-480.el9                      appstream               12 k
 perl-Socket                         x86_64              4:2.031-4.el9                     appstream               54 k
 perl-Storable                       x86_64              1:3.21-460.el9                    appstream               95 k
 perl-Symbol                         noarch              1.08-480.el9                      appstream               14 k
 perl-Term-ANSIColor                 noarch              5.01-461.el9                      appstream               48 k
 perl-Term-Cap                       noarch              1.17-460.el9                      appstream               22 k
 perl-TermReadKey                    x86_64              2.38-11.el9                       appstream               36 k
 perl-Text-ParseWords                noarch              3.30-460.el9                      appstream               16 k
 perl-Text-Tabs+Wrap                 noarch              2013.0523-460.el9                 appstream               23 k
 perl-Time-Local                     noarch              2:1.300-7.el9                     appstream               33 k
 perl-URI                            noarch              5.09-3.el9                        appstream              108 k
 perl-base                           noarch              2.27-480.el9                      appstream               16 k
 perl-constant                       noarch              1.33-461.el9                      appstream               23 k
 perl-if                             noarch              0.60.800-480.el9                  appstream               14 k
 perl-interpreter                    x86_64              4:5.32.1-480.el9                  appstream               71 k
 perl-lib                            x86_64              0.65-480.el9                      appstream               15 k
 perl-libnet                         noarch              3.13-4.el9                        appstream              125 k
 perl-libs                           x86_64              4:5.32.1-480.el9                  appstream              2.0 M
 perl-mro                            x86_64              1.23-480.el9                      appstream               28 k
 perl-overload                       noarch              1.31-480.el9                      appstream               46 k
 perl-overloading                    noarch              0.02-480.el9                      appstream               13 k
 perl-parent                         noarch              1:0.238-460.el9                   appstream               14 k
 perl-podlators                      noarch              1:4.14-460.el9                    appstream              112 k
 perl-subs                           noarch              1.03-480.el9                      appstream               12 k
 perl-vars                           noarch              1.05-480.el9                      appstream               13 k
Installing weak dependencies:
 perl-IO-Socket-SSL                  noarch              2.073-1.el9                       appstream              217 k
 perl-Mozilla-CA                     noarch              20200520-6.el9                    appstream               12 k
 perl-NDBM_File                      x86_64              1.15-480.el9                      appstream               22 k

Transaction Summary
========================================================================================================================
Install  66 Packages
...
Complete!

Gitのバージョンを確認する!

インストールされたGitのバージョンを確認します。

$ git -v
git version 2.39.3

おわりに

Rocky Linux 9では、Gitはデフォルトのリポジトリからインストールすることができます。