在 Debian Lenny 服务器上安装 Git

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10116113/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:45:41  来源:igfitidea点击:

Installing Git on a Debian Lenny server

gitdebianlenny

提问by dmmd

Sorry in advance if there's already an answer for this somewhere in the world, but I'm already 3h trying to install this in my PRODUCTION server, and I'm not getting anywhere.

如果世界上某个地方已经有答案,请提前抱歉,但我已经尝试在我的 PRODUCTION 服务器中安装它 3 小时,但我什么也没有得到。

My needs:

我的需求:



I want to run git commands (eg.: push, commit, etc) on my server. In order to do that, I need the "git" command (duh!).

我想在我的服务器上运行 git 命令(例如:push、commit 等)。为了做到这一点,我需要“git”命令(废话!)。

What I tried:

我试过的:



Tried to follow this: http://oli.zilla.org.uk/2010/12/07/installing-git-on-debian-lenny.html

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

And this: Git for beginners: The definitive practical guide

还有这个:Git 初学者:权威实用指南

And this: Installing Rails Plugin Requires Git?

还有这个:安装 Rails 插件需要 Git?

Tried to download the source (http://packages.debian.org/lenny/i386/git-core/download), the .deb file (http://ftp.de.debian.org/debian/pool/main/g/git/)

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

Problems:

问题:



404 when trying to get the source: http://packages.debian.org/lenny/i386/git-core/download

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

All the repositories I've tried to use gave me a 404 when downloading the packages

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

Need to update the libc6 from 2.7 to 2.9 in order to install the git-1.7.9 as seen in:

需要将 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

but couldn't find the 2.9 for Debian lenny

但找不到 Debian lenny 的 2.9



Final question:

最后的问题:

How do I install git on my Debian 5 (lenny) ?

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



Tries

尝试

Tried @sarnold solution, but (more 404s): http://justpaste.it/w5s

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





Solution:

解决方案:

Used @sarnold's comment (in his own answer)!

使用@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.

啊。莱尼已从镜子中移开。您需要编辑您的sources.list 以使用archive.debian.org —— 用于您所有的包行,而不仅仅是这个新行。请考虑将此系统升级到受支持的版本。

How to:

如何:

Edit the contents of /etc/apt/sources.list:

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

nano /etc/apt/sources.list

Add the following:

添加以下内容:

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

Update apt-get cache:

更新 apt-get 缓存:

apt-get update

Install git:

安装git:

apt-get install git-core

Done! :)

完毕!:)

Late edit:

后期编辑:

For some reason, it seems that the Deutsch mirror still valid. Just add

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

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

to your sources.list and try to get the package.

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

Or, of course, try the Debian backports:

或者,当然,尝试 Debian 向后移植:

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

采纳答案by sarnold

Because Lenny is no longer supported, I strongly recommend migrating this machine (or services) to a newer release. At the very least, severely firewall this machine and restrict access to it to only the most trusted of your users -- without security updates, a newly discovered remote compromise or local privilege escalation could give you far more trouble than upgrading.

由于不再支持 Lenny,我强烈建议将此机器(或服务)迁移到更新的版本。至少,对这台机器进行严格的防火墙设置,并将其访问权限限制在您最信任的用户中——如果没有安全更新,新发现的远程入侵或本地权限提升可能会给您带来比升级更多的麻烦。

That said, the backports projectprovides newer builds of packages for older systems. You can add the required debline to your aptsources.listfile-- I'm going to guess it looks something like this:

也就是说,backports 项目为旧系统提供了更新的包构建。您可以将所需的deb行添加到您的aptsources.list文件中——我猜它看起来像这样:

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

then run

然后运行

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

(I'm taking the git-allpackage name from a packages.debian.org lookup, which shows it is available for lenny-backports.)

(我git-allpackages.debian.org 查找中获取包名,这表明它可用于lenny-backports。)

The -tpinsthat package to that release. It's not something you'd use every day, but the one time you need it, it is worth its weight in saffron.

封装到该版本的-t引脚。它不是你每天都会使用的东西,但在你需要它的时候,它在藏红花中的分量是值得的。

回答by djhaskin987

  1. Install the debian backports repository (it won't update from there unless you explicitly ask it to):

    # echo 'deb http://backports.debian.org/debian-backports lenny-backports main'\
           >> /etc/apt/sources.list
    
  2. Install git:

    apt-get -t lenny-backports install git-core
    
  1. 安装 debian backports 存储库(除非您明确要求,否则它不会从那里更新):

    # echo 'deb http://backports.debian.org/debian-backports lenny-backports main'\
           >> /etc/apt/sources.list
    
  2. 安装git:

    apt-get -t lenny-backports install git-core
    

where the -t lenny-backportstells it explicitly to look for git in backports.

其中,-t lenny-backports告诉它明确地寻找在反向移植饭桶。

See thissite.

看到这个网站。

Also, the above directions were edited and really taken from the directions for squeeze backports, although I believe they work. I don't know if this is an option on a production server, but I guess Debian is not providing much support for lenny anymore, according to this:

此外,上述说明经过编辑,实际上取自挤压向后移植的说明,尽管我相信它们有效。我不知道这是否是生产服务器上的一个选项,但我猜 Debian 不再为 lenny 提供太多支持,根据这个

lenny backports discontinued

Following the normal Debian Archive lenny-backports is now discontinued. That means that no upload will be possible anymore and lenny-backports(-sloppy) get moved to archive.debian.org. If you haven't updated yet - now is the time to move to squeeze.

Some numbers about lenny-backports and lenny-backports-sloppy:

Source packages: lenny-backports: 667 - sloppy: 21
Uploads: lenny-backports: 1445 - sloppy: 51
Contributors: lenny-backports: 146 - sloppy: 17

Without all those contributors lenny-backports wouldn't have been possible. Thank you very much for your support! Posted Sun Mar 25 09:07:14 2012

lenny backports 停产

遵循正常的 Debian 存档 lenny-backports 现在已停止。这意味着无法再上传,并且 lenny-backports(-sloppy) 将移至 archive.debian.org。如果您还没有更新 - 现在是时候开始挤压了。

关于 lenny-backports 和 lenny-backports-sloppy 的一些数字:

Source packages: lenny-backports: 667 - sloppy: 21
Uploads: lenny-backports: 1445 - sloppy: 51
Contributors: lenny-backports: 146 - sloppy: 17

如果没有所有这些贡献者,lenny-backports 是不可能的。非常感谢您的支持!2012 年 3 月 25 日星期日 09:07:14 发布

回答by user3455207

Worked for me (git clone https:// ... would failed with tls error) :

对我来说有效(git clone https:// ... 会因 tls 错误而失败):

  • manually compile and re-install newer libcurl3-gnutls and git from source
  • 从源代码手动编译并重新安装较新的 libcurl3-gnutls 和 git

Debian Lenny ; standard version libcurl3-gnutls 7.18.2-8lenny6 has a bug with http/https behind a proxy.

Debian 莱尼;标准版本 libcurl3-gnutls 7.18.2-8lenny6 在代理后面有一个带有 http/https 的错误。

first : libcurl3-gnutls :

第一: libcurl3-gnutls :

then : git :

然后:git:

  • if needed : remove previous git : # apt-get remove --purge git git-core
  • # wget .......... git-1.9.0.tar.gz
  • # tar -zxf git-1.9.0.tar.gz
  • # cd git-1.9.0
  • # make prefix=/usr/local install
  • 如果需要:删除以前的 git :# apt-get remove --purge git git-core
  • # wget ..................... git-1.9.0.tar.gz
  • # tar -zxf git-1.9.0.tar.gz
  • # cd git-1.9.0
  • # make prefix=/usr/local install

refresh bash cache (if needed)

刷新 bash 缓存(如果需要)

  • $ type git
  • $ hash -r
  • $ 输入 git
  • $哈希 -r

and ... test :

和...测试:

  • $ git ls-remote --heads https:// [github] /jeromerobert/jCAE.git
  • $ git clone https:// [github] ... flask-sphinx-themes.git
  • $ git ls-remote --heads https:// [github] /jeromerobert/jCAE.git
  • $ git clone https:// [github] ... flask-sphinx-themes.git

Hope it helps.

希望能帮助到你。

Cavaliba.

卡瓦利巴。

回答by user2743554

My solution:

我的解决方案:

  • EDIT /etc/apt/sources.list:

    deb http://archive.debian.org/debian            lenny            main non-free contrib
    deb http://archive.debian.org/debian-security   lenny/updates    main non-free contrib
    deb http://archive.debian.org/debian-backports  lenny-backports  main
    
  • apt-get update

  • apt-get install -t lenny-backports git-core --no-install-recommends
  • 编辑/etc/apt/sources.list:

    deb http://archive.debian.org/debian            lenny            main non-free contrib
    deb http://archive.debian.org/debian-security   lenny/updates    main non-free contrib
    deb http://archive.debian.org/debian-backports  lenny-backports  main
    
  • apt-get 更新

  • apt-get install -t lenny-backports git-core --no-install-recommends