我想将git安装到一个服务器中,我只是一个没有“sudo”访问权限的用户。所以我不能使用yum install git
。
我尝试从https://www.kernel.org/pub/software/scm/git/(v2.11.0.tar.gz)和github(v2.3.0.zip)下载源代码。
在编译源时,错误发生了:
imap-send.c: In function ‘setup_curl’:
imap-send.c:1408: error: ‘CURLOPT_USERNAME’ undeclared (first use in this function)
imap-send.c:1408: error: (Each undeclared identifier is reported only once
imap-send.c:1408: error: for each function it appears in.)
imap-send.c:1409: error: ‘CURLOPT_PASSWORD’ undeclared (first use in this function)
imap-send.c:1434: error: ‘CURLOPT_USE_SSL’ undeclared (first use in this function)
imap-send.c:1434: error: ‘CURLUSESSL_TRY’ undeclared (first use in this function)
make: *** [imap-send.o] Error 1
make: *** Waiting for unfinished jobs....
两个版本给出了相同的错误。我检查了github的源代码并得到了代码的位置,但我无法理解为什么会发生错误。
如果没有管理员权限,我应该如何进入服务器(CentOS)。
答案 0 :(得分:5)
我自己解决了这个问题。
很明显,这个问题是由卷曲引起的。
使用which curl
查看正确的卷曲路径。在我的服务器中,它是:
/home/myname/Programs/Anaconda/bin/curl
所以是蟒蛇改变了我的卷曲。
通过
设置卷曲路径
git-2.11.0 $ ./configure --with-curl=$/home/myname/Programs/Anaconda/bin/curl
前
git-2.11.0 $ make prefix=/home/myname/path/to/install all
然后
git-2.11.0 $ make install prefix=/home/myname/path/to/install DESTDIR=/home/myname/path/to/install