![](/img/trans.png)
[英]Tesseract: An alternative to building a source in linux remote host?
[英]Git 'remote-https' not being installed when building source
我正在嘗試在運行CentOS Linux 7.7.1908
的服務器上從源代碼安裝 git 我沒有 root 權限。
我之前使用 Conda 安裝 Git 和其他一些工具,因為它不需要 root 訪問權限,但它不是一個干凈的解決方案,我必須多次停用環境才能使用某些程序。 因此,為了方便起見,我試圖將源代碼中的東西安裝到我的 ~/.local 樹中,作為學習練習。
從源代碼安裝到我的用戶目錄后,我可以使用 git 可執行文件克隆 SSH 遙控器,但不能克隆 HTTPS。這是問題示例:
$ git clone https://github.com/test/test.git ~/tmp/test_repo
Cloning into '/home/group/user/tmp/test_repo'...
git: 'remote-https' is not a git command. See 'git --help'.
問題似乎是由 Git 構建系統無法識別我系統上的 curl/libcurl 引起的。
大多數人的解決方案是使用 package 管理器來安裝 libcurl-devel 或類似的。 我不能做到這一點。
我確實安裝了 curl,無論這個 CentOS 版本附帶什么,我假設:
$ curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.44 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
我也嘗試過在我的用戶目錄中從源代碼安裝 openSSL 和 curl,但在嘗試構建 Git 后我得到了相同的結果:
$ curl -V
curl 7.85.0 (x86_64-pc-linux-gnu) libcurl/7.85.0 OpenSSL/1.1.1q zlib/1.2.7
Release-Date: 2022-08-31
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
我的Git安裝步驟如下:
$ make configure
$ ./configure --prefix=$HOME/tmp/git_test
$ make all -j
$ make install
運行新生成的二進制文件后,我得到相同的結果:
$ ./bin/git clone https://github.com/test/test.git ~/tmp/clone_test
Cloning into '/home/user/tmp/clone_test'...
git: 'remote-https' is not a git command. See 'git --help'.
我假設問題與我的 libcurl 安裝有關,但我只是不知道連接在哪里搞砸了!
編輯:我嘗試通過提取 RPM 二進制文件 package 來安裝 libcurl-devel。現在我有以下目錄結構:
├── bin
│ └── curl-config
├── include
│ └── curl
│ ├── curlbuild-64.h
│ ├── curlbuild.h
│ ├── curl.h
│ ├── curlrules.h
│ ├── curlver.h
│ ├── easy.h
│ ├── mprintf.h
│ ├── multi.h
│ ├── stdcheaders.h
│ └── typecheck-gcc.h
├── lib64
│ ├── libcurl.so -> libcurl.so.4.3.0
│ ├── libcurl.so.4 -> libcurl.so.4.3.0
│ ├── libcurl.so.4.3.0
│ └── pkgconfig
│ └── libcurl.pc
└── share
├── aclocal
│ └── libcurl.m4
├── doc
│ └── libcurl-devel-7.29.0
└── man
├── man1
└── man3
為了解決我的問題,我需要知道 Git 的配置/制作工具檢測系統是否安裝了 libcurl 的機制。
您需要使用--with-curl
、 --with-openssl
,可能還有--with-expat
$ ./configure --prefix=$HOME/tmp/git_test --with-curl=/curl/install/prefix ... etc.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.