Ubuntu 22.04 desktop Git install

这篇博客详细介绍了在Linux环境下手动安装Git的过程,包括下载Git源码、解压、编译和安装。在安装过程中遇到了两个依赖问题:缺少openssl/ssl.h头文件和curl/curl.h头文件。为解决这些问题,博主提供了下载openssl和curl源码,配置并安装的步骤。通过这些步骤,读者可以成功地在系统中安装Git。

Here used src to install git.

CMD:

	wget -c https://github.com/git/git/archive/v2.26.2.tar.gz -O - | sudo tar -xz -C /usr/src
	cd /usr/src/git-*
	sudo make prefix=/usr/local all
	sudo make prefix=/usr/local install
	
	git --version

Errors and Fix

  1. git-compat-util.h:280:25: fatal error: openssl/ssl.h: 没有那个文件或目录
    download the package: https://www.openssl.org/source/
    details reference: INSTALL.md, decompression the package and cd to the folder.

    sudo make install
    sudo ./Configure --prefix=/opt/openssl --openssldir=/usr/local/ssl
    
  2. http.h:6:10: fatal error: curl/curl.h: 没有那个文件或目录
    download the package: https://curl.se/download.html

    tar -zxvf curl-7.83.1.tar.gz
    cd curl-7.83.1
    sudo ./configure
    sudo make
    sudo make install
    
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值