Ubuntu 18 安裝最新版 Git-2.30.0
在 2020年7月31日,安裝了當時最新版 Git-2.28.0 版本,今天繼續基於 Linux 系統下安裝目前最新版 Git-2.30.0,希望對各位有點幫助。
1、訪問官網,查看發佈說明。
官網鏈接: https://git-scm.com/
由於官網下載非常的慢,友情推薦個可以快速下載的鏈接給各位,需要的可以保存一下。
https://mirrors.edge.kernel.org/pub/software/scm/git/
2、找到最新版本 git-2.30.0.tar.gz 的軟件包,進行下載。
下載完成,授權解決壓縮包,然後刪除本機安裝的舊版本,如下圖所示的操作。
卸載完成後,執行一下清理。
3、更新安裝源,安裝一些依賴軟件庫。
要安裝的一些依賴軟件及依賴庫,執行下面的指令:
$ sudo apt-get install -y libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev dh-autoreconf libghc-zlib-dev
$ sudo apt-get install -y libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev dh-autoreconf libghc-zlib-dev
[sudo] password for scm:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'zlib1g-dev' instead of 'libz-dev'
dh-autoreconf is already the newest version (17).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
libghc-zlib-dev is already the newest version (0.6.1.2-1build1).
gettext is already the newest version (0.19.8.1-6ubuntu0.3).
libcurl4-gnutls-dev is already the newest version (7.58.0-2ubuntu3.12).
libexpat1-dev is already the newest version (2.2.5-3ubuntu0.2).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.7).
0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
scm@patac:~$
4、編譯和安裝。
進入解壓的源碼目錄 git-2.30.0 ,進行 編譯和安裝。
$ sudo make prefix=/usr/local all # 執行編譯
$ sudo make prefix=/usr/local install # 執行安裝
安裝完成,查看版本,已經是最新的 git 2.30.0 版本了。