【问题处理】git lfs install执行失败
在ubuntu24操作系统中,执行失败。报错信息如下,
·
问题描述
在ubuntu24操作系统中,git lfs install 执行失败。
报错信息如下,
root@VM-4-3-ubuntu:~# git lfs install
git: 'lfs' is not a git command. See 'git --help'.
The most similar command is
log
处理办法
浏览器访问,
https://github.com/git-lfs/git-lfs/releases
找到适合自己设备环境的安装包,我当前设备采用的64位CPU的Linux,选下图所示安装包
下载后,复制文件到系统,下图所示,
解压文件,tar -zxf git-lfs-linux-amd64-v3.6.1.tar.gz ,下图所示,
下图所示,安装软件,
root@VM-4-3-ubuntu:/home/ubuntu# cd git-lfs-3.6.1/
root@VM-4-3-ubuntu:/home/ubuntu/git-lfs-3.6.1# ll
total 12084
drwxr-xr-x 3 root root 4096 Apr 18 10:19 ./
drwxr-x--- 6 ubuntu ubuntu 4096 Apr 18 10:19 ../
-rw-r--r-- 1 lighthouse docker 122421 Dec 4 12:00 CHANGELOG.md
-rwxr-xr-x 1 lighthouse docker 12218520 Dec 4 12:02 git-lfs*
-rwxr-xr-x 1 lighthouse docker 803 Dec 4 12:00 install.sh*
drwxr-xr-x 6 lighthouse docker 4096 Dec 4 12:01 man/
-rw-r--r-- 1 lighthouse docker 10050 Dec 4 12:00 README.md
root@VM-4-3-ubuntu:/home/ubuntu/git-lfs-3.6.1# ./install.sh
Git LFS initialized.
root@VM-4-3-ubuntu:/home/ubuntu/git-lfs-3.6.1# pwd
/home/ubuntu/git-lfs-3.6.1
查看安装后的版本
root@VM-4-3-ubuntu:~# git lfs --version
git-lfs/3.6.1 (GitHub; linux amd64; go 1.23.3; git ea47a34b)
说明
该方法适用于主流Linux发行版。优先下载安装最新版的git lfs可以规避历史遗留问题或者已被普遍利用的安全漏洞。
更多推荐
所有评论(0)