You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS7编译Git2.0.1报错:找不到curl/curl.h文件求助

Fixing "curl/curl.h: No such file or directory" When Compiling Git on CentOS 7

Hey friend, that error shows up because your CentOS 7 system is missing the libcurl development headers—Git relies on these to build its HTTP/HTTPS-related features. Let's get this sorted out step by step:

Step 1: Install the missing dependency

First, install the curl-devel package which includes the missing curl/curl.h header file. Run this with sudo privileges:

sudo yum install curl-devel

If you want to avoid other potential missing dependency errors down the line, you can install a full set of common build dependencies for Git in one go:

sudo yum install gcc autoconf zlib-devel openssl-devel expat-devel gettext-devel curl-devel

Step 2: Recompile Git

Navigate back to your Git source directory if you moved away from it:

cd git-2.0.1

Then re-run the compile command you used earlier:

make prefix=/usr/local/git all

Step 3: Install Git (after successful compilation)

Once the build finishes without errors, install Git to your specified location:

sudo make prefix=/usr/local/git install

To make Git accessible system-wide, add its bin directory to your PATH. Edit your ~/.bashrc file and append this line at the end:

export PATH=/usr/local/git/bin:$PATH

Reload the shell configuration to apply the change immediately:

source ~/.bashrc

You can confirm the installation worked by checking the Git version:

git --version

内容的提问来源于stack exchange,提问作者sof-03

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 04:24:44