linux安装git

257 阅读1分钟

linux安装git

[root@hecs-82454 local]# git --version
-bash: git: command not found
[root@hecs-82454 local]# yum -y install git
Loaded plugins: fastestmirror
Determining fastest mirrors
base                                                                       | 3.6 kB  00:00:00     
docker-ce-stable                                                           | 3.5 kB  00:00:00     
epel                                                                       | 4.7 kB  00:00:00     
extras                                                                     | 2.9 kB  00:00:00     
updates                                                                    | 2.9 kB  00:00:00     
(1/4): docker-ce-stable/7/x86_64/primary_db                                |  66 kB  00:00:00     
(2/4): epel/x86_64/updateinfo                                              | 1.0 MB  00:00:00     
(3/4): epel/x86_64/primary_db                                              | 7.0 MB  00:00:00     
(4/4): updates/7/x86_64/primary_db                                         |  12 MB  00:00:01     
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-23.el7_8 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-23.el7_8 for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-23.el7_8.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-23.el7_8 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package rsync.x86_64 0:3.1.2-10.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================
 Package                     Arch              Version                      Repository       Size
==================================================================================================
Installing:
 git                         x86_64            1.8.3.1-23.el7_8             base            4.4 M
Installing for dependencies:
 perl-Error                  noarch            1:0.17020-2.el7              base             32 k
 perl-Git                    noarch            1.8.3.1-23.el7_8             base             56 k
 perl-TermReadKey            x86_64            2.30-20.el7                  base             31 k
 rsync                       x86_64            3.1.2-10.el7                 base            404 k

Transaction Summary
==================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 4.9 M
Installed size: 23 M
Downloading packages:
(1/5): perl-Error-0.17020-2.el7.noarch.rpm                                 |  32 kB  00:00:00     
(2/5): perl-Git-1.8.3.1-23.el7_8.noarch.rpm                                |  56 kB  00:00:00     
(3/5): perl-TermReadKey-2.30-20.el7.x86_64.rpm                             |  31 kB  00:00:00     
(4/5): rsync-3.1.2-10.el7.x86_64.rpm                                       | 404 kB  00:00:00     
(5/5): git-1.8.3.1-23.el7_8.x86_64.rpm                                     | 4.4 MB  00:00:02     
--------------------------------------------------------------------------------------------------
Total                                                             2.1 MB/s | 4.9 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : 1:perl-Error-0.17020-2.el7.noarch                                              1/5 
  Installing : rsync-3.1.2-10.el7.x86_64                                                      2/5 
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                                            3/5 
  Installing : perl-Git-1.8.3.1-23.el7_8.noarch                                               4/5 
  Installing : git-1.8.3.1-23.el7_8.x86_64                                                    5/5 
  Verifying  : git-1.8.3.1-23.el7_8.x86_64                                                    1/5 
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                              2/5 
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                            3/5 
  Verifying  : perl-Git-1.8.3.1-23.el7_8.noarch                                               4/5 
  Verifying  : rsync-3.1.2-10.el7.x86_64                                                      5/5 

Installed:
  git.x86_64 0:1.8.3.1-23.el7_8                                                                   

Dependency Installed:
  perl-Error.noarch 1:0.17020-2.el7                 perl-Git.noarch 0:1.8.3.1-23.el7_8            
  perl-TermReadKey.x86_64 0:2.30-20.el7             rsync.x86_64 0:3.1.2-10.el7                   

Complete!
[root@hecs-82454 local]# git --version
git version 1.8.3.1
[root@hecs-82454 local]#