安装 git lfs install
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
参考链接:Installing on Linux using packagecloud
Clone资源
git lfs install
git clone https://huggingface.co/THUDM/chatglm2-6b
- 报错1
fatal: unable to access 'https://huggingface.co/THUDM/chatglm2-6b/': gnutls_handshake() failed: Error in the pull function.
- 解决方案
# 安装软件包依赖
sudo apt-get install -y build-essential fakeroot dpkg-dev
sudo apt-get -y build-dep git
sudo apt-get install -y libcurl4-openssl-dev
# 创建目录
mkdir git-openssl
cd git-openssl
# 获取 git 源码
apt-get source git
cd git-*
# 修改 git 安装包配置文件
# 将 libcurl4-gnutls-dev 替换为 libcurl4-openssl-dev
sed -i -e 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/g' ./debian/control
# 删除 TEST=test,缩短安装包构建时间
sed -i -- '/TEST\s*=\s*test/d' ./debian/rules
# 构建安装包
sudo dpkg-buildpackage -rfakeroot -b
# 安装,git 版本号可能不一致
cd ../
sudo dpkg -i git_2.17.1-1ubuntu0.8_amd64.deb
# 清理
cd ../../
sudo rm -rf git-openssl
参考链接:解决 git 同步错误 gnutls_handshake() failed
- 报错2
fatal: unable to access 'http://huggingface.co/THUDM/chatglm2-6b/': OpenSSL SSL_connect: Connection reset by peer in connection to huggingface.co:443
- 解决方案(127.0.0.1:8087配置为自己的实际代理ip及端口)
git config --global http.proxy 127.0.0.1:8087
git config --global http.sslVerify false
参考链接:OpenSSL SSL_connect: Connection was reset in connection to github.com:443