ubuntu 18.04 git2.17.1升级 2.41

发布时间 2023-08-18 13:14:08作者: 悟透

默认安装版本

image


一、添加 git 官方源

sudo add-apt-repository ppa:git-core/ppa

根据提示 回车继续
image


二、更新仓库包索引

sudo apt update

不更新,即便 git 官方有更新,你也搜索不到


三、查看有什么软件可以更新

apt list --upgradable

可以看到左边红箭头,显示是最新的 git 2.41,而右边箭头是系统里装的 2.17.1 版本
image


四、安装最新版本

sudo apt-get install git

安装最新版本后:
Ubunt:
image
Window:
image


五、安装指定版本

sudo apt-get install git=2.22

一些可用版本号:

2.15.1
2.18
2.28
2.30
2.39.1


六、apt-cache 列出你系统里可安装版本

1.apt-cache madison

sudo apt-cache madison git

image


2.apt-cache policy

sudo apt-cache policy  git

image


七、如果二进制没有想要的版本,可以用源码编译安装

https://blog.csdn.net/qq_27061049/article/details/130202387





参考、来源:
http://www.taodudu.cc/news/show-6238481.html?action=onClick
https://codeleading.com/article/14053817028/
https://blog.csdn.net/rookie_wei/article/details/122409853
https://blog.csdn.net/xuchaoxin1375/article/details/124586717
https://blog.51cto.com/wst021sh/5087544