gpt4 book ai didi

git - 在 Debian Lenny 服务器上安装 Git

转载 作者:IT王子 更新时间:2023-10-29 00:48:05 25 4
gpt4 key购买 nike

如果世界上某个地方已经有这个问题的答案,请提前道歉,但我已经花了 3 小时尝试将它安装到我的生产服务器中,但我没有任何进展。

我的需求:


我想在我的服务器上运行 git 命令(例如:推送、提交等)。为此,我需要“git”命令(呃!)。

我尝试了什么:


试图遵循这个:http://oli.zilla.org.uk/2010/12/07/installing-git-on-debian-lenny.html

还有这个:Git for beginners: The definitive practical guide

还有这个:Installing Rails Plugin Requires Git?

试图下载源代码(http://packages.debian.org/lenny/i386/git-core/download),.deb 文件(http://ftp.de.debian.org/debian/pool/main/g/git/)

问题:


尝试获取来源时出现 404:http://packages.debian.org/lenny/i386/git-core/download

我尝试使用的所有存储库在下载包时都给了我 404

需要将 libc6 从 2.7 更新到 2.9 才能安装 git-1.7.9,如下所示:

stewie:/tmp# dpkg -i git_1.7.9-1~bpo60+1_i386.deb 
Selecting previously deselected package git.
(Reading database ... 20477 files and directories currently installed.)
Unpacking git (from git_1.7.9-1~bpo60+1_i386.deb) ...
dpkg: dependency problems prevent configuration of git:
git depends on libc6 (>= 2.9); however:
Version of libc6 on system is 2.7-18lenny7.
git depends on libcurl3-gnutls (>= 7.16.2-1); however:
Package libcurl3-gnutls is not installed.
git depends on libexpat1 (>= 1.95.8); however:
Package libexpat1 is not installed.
git depends on liberror-perl; however:
Package liberror-perl is not installed.
git depends on git-man (>> 1:1.7.9); however:
Package git-man is not installed.
git depends on git-man (<< 1:1.7.9-.); however:
Package git-man is not installed.
dpkg: error processing git (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
git

但找不到 Debian lenny 的 2.9


最后一个问题:

如何在我的 Debian 5 (lenny) 上安装 git?


尝试

尝试了@sarnold 解决方案,但是(更多 404):http://justpaste.it/w5s



解决方案:

使用了@sarnold 的评论(在他自己的回答中)!

Ah. Lenny has been removed from the mirrors. You need to edit your sources.list to use archive.debian.org instead -- for all your package lines, not just this new one. Please consider upgrading this system to a supported release.

如何:

编辑/etc/apt/sources.list的内容:

nano /etc/apt/sources.list

添加以下内容:

deb http://archive.debian.org/debian/ lenny main non-free contrib
deb-src http://archive.debian.org/debian/ lenny main non-free contrib

deb http://archive.debian.org/debian-security/ lenny/updates main non-free contrib
deb-src http://archive.debian.org/debian-security/ lenny/updates main non-free contrib

更新 apt-get 缓存:

apt-get update

安装git:

apt-get install git-core

完成! :)

后期编辑:

出于某种原因,Deutsch 镜像似乎仍然有效。只需添加

deb http://ftp.de.debian.org/debian-archive/debian/ lenny main
deb-src http://ftp.de.debian.org/debian-archive/debian/ lenny main

到您的 sources.list 并尝试获取包。

或者,当然,试试 Debian backports:

deb http://backports.debian.org/debian-backports squeeze-backports main

最佳答案

因为 Lenny is no longer supported ,我强烈建议将这台机器(或服务)迁移到更新的版本。至少,严密设置这台机器的防火墙并将访问权限限制在您最信任的用户中——如果没有安全更新,新发现的远程危害或本地权限升级会给您带来比升级更多的麻烦。

也就是说,backports project为旧系统提供更新的软件包构建。你可以add the required deb line to your apt sources.list file -- 我猜它看起来像这样:

deb http://backports.debian.org/debian-backports lenny-backports main

然后运行

apt-get update
apt-get -u -t lenny-backports install git-all

(我从 packages.debian.org lookup 中获取 git-all 包名称,这表明它可用于 lenny-backports。)

-t pin 该包到该版本。它不是您每天都会使用的东西,但一旦您需要它,它就物有所值了。

关于git - 在 Debian Lenny 服务器上安装 Git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10116113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com