AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 111337
Accepted
Nick Bolton
Nick Bolton
Asked: 2010-02-10 14:22:43 +0800 CST2010-02-10 14:22:43 +0800 CST 2010-02-10 14:22:43 +0800 CST

如何使用 apt-get 在 Debian 5.0 (lenny) 上安装 Python 2.6?

  • 772

经过一些挖掘和实验,我想出了如何在 Debian 5.0 上使用apt-get. 所以我认为最好在 SF 上发布一个问题和答案。我知道这可以手动构建和安装,但很多人更喜欢使用apt-get(包括我自己)。

debian python debian-lenny
  • 3 3 个回答
  • 18368 Views

3 个回答

  • Voted
  1. Best Answer
    Andrew Moise
    2010-02-15T11:06:44+08:002010-02-15T11:06:44+08:00

    这是破坏系统的好方法;你最终会把各种稳定的东西升级到不稳定的,从那时起你就会遇到麻烦,因为 Debian 不是为在一个半稳定半不稳定的系统上运行而设计的。

    更好的方法是向后移植,但显然将 2.6 向后移植到 lenny 并不简单。

    • 5
  2. gaborous
    2012-01-12T14:17:00+08:002012-01-12T14:17:00+08:00

    使用 Apt-Pinning。

    我还不太习惯这个概念,但这似乎基本上意味着你配置你的 Debian 系统,这样你就可以直接使用 apt 从稳定的、测试的、未经测试的(以及可能的其他存储库,如 backports)安装软件包-get,不会破坏(太多)系统的依赖关系,因为默认情况下它会使用稳定的,并且只有当你需要它时它才会在其他存储库中搜索。

    这是一种非常好的、符合人体工程学且安全的方法,可以仅将 Debian 系统的某些部分更新到最新版本,而不会破坏系统的依赖关系和全局稳定性。

    关于 Apt-Pinning 的一个很好的教程:http: //jaqque.sbih.org/kplug/apt-pinning.html

    我在专用虚拟主机上使用 Lenny 和 Plesk,这是我的配置文件,于 2012 年 1 月 11 日制作:

    apt.conf

    APT::Cache-Limit "16777216";
    

    来源.list

    #Stable
    deb http://ftp.de.debian.org/debian lenny main contrib non-free
    deb http://ftp.de.debian.org/debian-volatile lenny/volatile main contrib non-free
    deb http://ftp.de.debian.org/debian-security lenny/updates main contrib non-free
    
    #Proposed updates
    deb http://ftp.de.debian.org/debian lenny-proposed-updates main contrib non-free
    deb http://ftp.de.debian.org/debian-volatile lenny-proposed-updates/volatile main contrib non-free
    
    #Testing
    deb http://ftp.de.debian.org/debian testing main contrib non-free
    
    #Unstable
    deb http://ftp.de.debian.org/debian unstable main contrib non-free
    
    #Backports
    deb http://ftp.de.debian.org/debian-backports lenny-backports main contrib non-free
    
    #Plesk (? what does it do? install additional modules from the webinterface?)
    #Uncomment the next line only if you have Plesk installed.
    #deb http://autoinstall.plesk.com/debian/PSA10 lenny all
    

    喜好

    Package: *
    Pin: release a=stable
    Pin-Priority: 700
    
    Package: *
    Pin: release a=lenny-proposed-updates
    Pin-Priority: 650
    
    Package: *
    Pin: release a=testing
    Pin-Priority: 600
    
    Package: *
    Pin: release a=unstable
    Pin-Priority: 550
    
    Package: *
    Pin: release a=lenny-backports
    Pin-Priority: 500
    

    这些文件都要放在/etc/apt/目录下

    然后,您可以使用 apt-get python,它会直接在您的系统上安装 python 2.7 以及所有依赖项!如果您想安装较新的版本(例如 3.x),您可以尝试我链接的页面中给出的建议,以强制查看其他存储库:

    apt-get install <package>/unstable
    #This will install the unstable version of the package, and try to meet any dependencies from Stable.
    

    或者

    apt-get -t unstable install <package>
    #This will install the Unstable version of the package, and try to meet any dependencies from Unstable.
    
    • 2
  3. Nick Bolton
    2010-02-10T14:26:50+08:002010-02-10T14:26:50+08:00

    更新:删除了答案,因为它涉及一些滥用能力。最好的方法实际上是使用源安装 2.6(虽然这有点困难,但不太可能搞砸你的系统)。

    • -1

相关问题

  • 关闭 FTP

  • 如何在同一台电脑上从 putty 连接 debian vmware

  • debian- 文件到包的映射

  • Debian Ubuntu 网络管理器错误 [关闭]

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve