[英]GnuTLS recv error (-110): The TLS connection was non-properly terminated
設置vimrc后,我正准備通過vundle安裝vim插件
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'valloric/youcompleteme'
call vundle#end()
然后我輸入:PluginInstall
並得到錯誤
2 [2018-09-27 10:47:17] Plugin valloric/youcompleteme | 18 " line enables syntax highlighting by default.
3 [2018-09-27 10:47:17] $ git clone --recursive 'https://github.com/valloric/youcompleteme.git' '/roo| 19 syntax on;
t/.vim/bundle/youcompleteme' | 20 if has("syntax")
4 [2018-09-27 10:47:17] > Cloning into '/root/.vim/bundle/youcompleteme'... | 21 syntax on
5 [2018-09-27 10:47:17] > error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was| 22 endif
non-properly terminated.
然后我轉到目錄~/.vim/bundle
並執行
git clone --recursive 'https://github.com/valloric/youcompleteme.git
得到這個
Cloning into '~/.vim/bundle/youcompleteme'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 34431 (delta 4), reused 8 (delta 1), pack-reused 34416
Receiving objects: 100% (34431/34431), 32.58 MiB | 2.37 MiB/s, done.
error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
Resolving deltas: 100% (12305/12305), done.
如上所述, 盡管出現錯誤,但似乎插件已被下載。 但實際上我找不到youcompleteme
目錄。
我也試試
git clone --recursive 'git@github.com:Valloric/YouCompleteMe.git' '~/.vim/bundle/youcompleteme'
得到這個
Cloning into '~/.vim/bundle/youcompleteme'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
那么如何解決這個問題呢?
重新編譯安裝git終於解決了,步驟如下:
sudo apt-get install build-essential fakeroot dpkg-dev -y
sudo apt-get build-dep git -y
sudo apt-get install libcurl4-openssl-dev -y
cd ~
mkdir source-git
cd source-git/
apt-get source git
cd git-2.*.*/
sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control
sed -i -- '/TEST\s*=\s*test/d' ./debian/rules
dpkg-buildpackage -rfakeroot -b -uc -us
sudo dpkg -i ../git_*ubuntu*.deb
並且不使用-y
是可以的, -y
只是為了跳過輸入y
。 結果是:
Cloning into 'syntastic'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 18671 (delta 9), reused 16 (delta 5), pack-reused 18644
Receiving objects: 100% (18671/18671), 4.26 MiB | 701.00 KiB/s, done.
Resolving deltas: 100% (10572/10572), done.
Checking connectivity... done.
對於任何可能在Windows 10 wsl2上遇到以下問題的人,可以使用以下參考進行修復:
fakeroot, while creating message channels: Function not implemented
This may be due to a lack of SYSV IPC support.
https://github.com/microsoft/WSL/issues/2465#issuecomment-377583291
sudo update-alternatives --set fakeroot /usr/bin/fakeroot-tcp
那么如何解決這個問題呢?
通過檢查這些錯誤是否在接下來的幾個小時內仍然存在。
GitHub 狀態報告現在
我們正在調查錯誤率升高的報告。
這可能是他們問題的副作用。
另一種方法是確保您使用的是最新的 Git 版本,OP 通過重新編譯 Git 來做到這一點。
這是一種更新的方法。 我在 Win10 上的 WSL2 上使用 Ubuntu 20.04。
sudo apt remove git -y
sudo apt update && sudo apt upgrade
DEBIAN_FRONTEND=noninteractive
sudo apt install build-essential autoconf dh-autoreconf libcurl4-openssl-dev \
tcl-dev gettext asciidoc docbook2x install-info \
libexpat1-dev libz-dev -y
wget https://raw.githubusercontent.com/paul-nelson-baker/git-openssl-shellscript/master/compile-git-with-openssl.sh .
./compile-git-with-openssl.sh -skiptests
我在這里找到了解決方案https://stdworkflow.com/652/error-rpc-failed-curl-56-gnutls-recv-error-110-the-tls-connection-was-non-properly-terminated ,我只是復制作者的答案:
問題似乎是 Ubuntu gnutls_handshake 的問題 解決方法
重新編譯 git
使用 libcurl-openssl-dev 替換 gnutls
安裝必要的依賴和環境
sudo apt-get install build-essential fakeroot dpkg-dev
如果你使用的是樹莓派,你會遇到本地問題,你可能無法設置本地,只要記住將
export LC_ALL=C
放在 .bashrc 文件中,然后重新啟動即可。
創建一個目錄放新編譯的git
mkdir ~/git-rectify
獲取 git 源代碼
cd ~/git-rectify
sudo apt-get source git
安裝 git 依賴項
sudo apt-get build-dep git
安裝 libcurl
sudo apt-get install libcurl4-openssl-dev
進入git目錄,目錄名取決於你安裝的版本
cd git-2.7.4/
修改兩個文件后重新編譯git
vim ./debian/control # Modify libcurl4-gnutls-dev to libcurl4-openssl-dev
vim ./debian/rules # delete the entire line of TEST=test
sudo dpkg-buildpackage -rfakeroot -b
回到上一個目錄,安裝編譯好的安裝包
cd .. # is in the ~/git-rectify directory
sudo dpkg -i git_2.7.4-0ubuntu0.4_amd64.deb
源碼安裝git這里只是記錄一下從源碼安裝git的步驟。
git clone https://github.com/git/git.git
切換到對應的版本標簽
git checkout -b v2.22.0
sudo apt-get install libssl-dev
按照doc文檔中描述的安裝命令進行安裝。
出於某種原因,'git pull' 一遍又一遍地給出這個消息,'git pull origin master' 雖然有效
在通過 Ubuntu 18.04 從 Visual Studio 和 WSL 運行 CMake 時,我找到了解決此問題的另一種方法。 我在這里找到了將 GIT 升級到最新版本的另一種方法: https ://itsfoss.com/install-git-ubuntu/
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
即使升級后我們仍然有 GnuTLS recv 錯誤(-110),GIT 操作也不會失敗。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.