Ubuntu 版本信息:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
安装 Git
安装 Git(第 1 行):
$ sudo apt-get install git
[sudo] password for mk:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
ca-certificates-mono cli-common libgdiplus libglib2.0-cil libgtk2.0-cil
libmono-addins-gui0.2-cil libmono-addins0.2-cil
libmono-btls-interface4.0-cil libmono-cairo4.0-cil libmono-corlib4.5-cil
libmono-i18n-west4.0-cil libmono-i18n4.0-cil libmono-posix4.0-cil
libmono-security4.0-cil libmono-sharpzip4.84-cil
libmono-system-configuration4.0-cil libmono-system-core4.0-cil
libmono-system-drawing4.0-cil libmono-system-numerics4.0-cil
libmono-system-security4.0-cil libmono-system-xml4.0-cil
libmono-system4.0-cil mono-4.0-gac mono-gac mono-runtime
mono-runtime-common mono-runtime-sgen
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 90 not upgraded.
Need to get 5,465 kB of archives.
After this operation, 38.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 liberror-perl all 0.17029-1 [26.5 kB]
0% [1 liberror-perl 21.3 kB/26.5 kB 81%] 3,295 B/s 27min 30% [1 liberror-perl 21.3 kB/26.5 kB 81%] 3,295 B/s 27min 32Get:2 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 git-man all 1:2.25.1-1ubuntu3.2 [884 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 git amd64 1:2.25.1-1ubuntu3.2 [4,554 kB]
Ign:3 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 git amd64 1:2.25.1-1ubuntu3.2
Get:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 git amd64 1:2.25.1-1ubuntu3.2 [4,554 kB]
Fetched 3,478 kB in 4min 20s (13.4 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 166422 files and directories currently installed.)
Preparing to unpack .../liberror-perl_0.17029-1_all.deb ...
Unpacking liberror-perl (0.17029-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.25.1-1ubuntu3.2_all.deb ...
Unpacking git-man (1:2.25.1-1ubuntu3.2) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.25.1-1ubuntu3.2_amd64.deb ...
Unpacking git (1:2.25.1-1ubuntu3.2) ...
Setting up liberror-perl (0.17029-1) ...
Setting up git-man (1:2.25.1-1ubuntu3.2) ...
Setting up git (1:2.25.1-1ubuntu3.2) ...
Processing triggers for man-db (2.9.1-1) ...
安装完成,查看 Git 版本(第 1 行):
$ git --version
git version 2.25.1