Debian 安装 git 1.首先配置/etc/apt/sources.list nano /etc/apt/sources.list deb http://ftp.cn.debian.org/debian/ stretch main deb http://ftp.cn.debian.org/debian/ stretch-updates main deb http://ftp.cn.debian.org/debian-security stretch/updates main 2. 更新包(如果这一步报错,尝试执行第三步,如果第三步也报错,文章最下面看) #默认一直回车即可 该输入yes的时候输入y 然后回车即可 sudo apt update 执行下方命令(如果第二步失败,执行下方命令,重新第二步) apt-get --fix-broken install sudo rm -fr /var/lib/apt/lists 3.安装git sudo apt install git 4.查看是否安装成功 git --version 如何sudo apt update 出错 可以参考一下下方的配置 [选择版本写入souce.list文件](https://mirrors.ustc.edu.cn/repogen/) 安装git的其他方法 [安装git描述](https://www.digitalocean.com/community/tutorials/how-to-install-git-on-debian-10#setting-up-git)