我在远程服务器场中有一个相当老的盒子。 所以我没有直接访问。 只有远程SSH(并通过SSH到串行控制台)。 我还没有更新这个箱子的年龄。 现在,无论何时我想安装一个新的软件包,都会显示glibc的依赖关系。 不幸的是,glibc的安装依赖于2.6内核,我正在运行一个可敬的2.4内核(还有一个更新的理由)。
问题是,新内核的安装对glibc有一个间接(超过语言环境)的依赖关系。 所以,要安装glibc,我需要一个新的内核。 对于新的内核,我需要升级glibc。 基本上我被封锁了。 有什么最好的方式来考虑我没有“硬件”访问?
以下是升级过程的简要说明:
[green:~]% sudo aptitude install linux-image-686 Reading Package Lists... Done Building Dependency Tree Reading extended state information Initializing package states... Done Reading task descriptions... Done The following packages are unused and will be REMOVED: gcc-4.3-base The following NEW packages will be automatically installed: dash libc6-i686 libparse-recdescent-perl linux-image-2.6-686 linux-image-2.6.18-6-686 module-init-tools yaird The following packages have been kept back: adduser apache2 apache2-mpm-prefork apache2-utils apache2.2-common apt apt-utils aptitude autoconf autotools-dev awstats base-files base-passwd [...snip...] util-linux vacation vim vim-common wamerican wbritish wget whiptail whois wwwconfig-common zlib1g The following NEW packages will be installed: dash libc6-i686 libparse-recdescent-perl linux-image-2.6-686 linux-image-2.6.18-6-686 linux-image-686 module-init-tools yaird The following packages will be upgraded: hotplug libc6 2 packages upgraded, 8 newly installed, 1 to remove and 277 not upgraded. Need to get 0B/22.7MB of archives. After unpacking 52.1MB will be used. Do you want to continue? [Y/n/?] Writing extended state information... Done Preconfiguring packages ... (Reading database ... 34065 files and directories currently installed.) Preparing to replace libc6 2.3.6.ds1-13 (using .../libc6_2.7-18lenny2_i386.deb) ... Checking for services that may need to be restarted... Checking init scripts... WARNING: init script for postgresql not found. [ --- libc6 config screen appears here --- ] WARNING: POSIX threads library NPTL requires kernel version 2.6.8 or later. If you use a kernel 2.4, please upgrade it before installing glibc. The installation of a 2.6 kernel _could_ ask you to install a new libc first, this is NOT a bug, and should *NOT* be reported. In that case, please add etch sources to your /etc/apt/sources.list and run: apt-get install -t etch linux-image-2.6 Then reboot into this new kernel, and proceed with your upgrade dpkg: error processing /var/cache/apt/archives/libc6_2.7-18lenny2_i386.deb (--unpack): subprocess pre-installation script returned error exit status 1 Errors were encountered while processing: /var/cache/apt/archives/libc6_2.7-18lenny2_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Ack! Something bad happened while installing packages. Trying to recover: dpkg: dependency problems prevent configuration of locales: locales depends on glibc-2.7-1; however: Package glibc-2.7-1 is not installed. dpkg: error processing locales (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: locales Reading Package Lists... Done Building Dependency Tree Reading extended state information Initializing package states... Done Reading task descriptions... Done
现在,如果我按照所指示的那样进行指导,我会得到以下结果。 请注意,我正在使用aptitude而不是apt-get来从更好的依赖关系跟踪中受益。 我确实先尝试apt-get 。 但是,让我也遇到同样的问题。
[green:~]% sudo aptitude install -t etch linux-image-2.6.26-2-686 Reading Package Lists... Done Building Dependency Tree Reading extended state information Initializing package states... Done Reading task descriptions... Done E: Unable to correct problems, you have held broken packages. E: Unable to correct dependencies, some packages cannot be installed E: Unable to resolve some dependencies! Some packages had unmet dependencies. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following packages have unmet dependencies: linux-image-2.6.26-2-686: Depends: initramfs-tools (>= 0.55) but it is not installable or yaird (>= 0.0.13) but it is not installable or linux-initramfs-tool which is a virtual package.
有任何想法吗?
在这个问题上,你说这台机器正在运行Debian 3.1(Sarge)。 但是,您发布的glibc依赖项和错误消息表明您正在尝试从Debian 5.0(Lenny)安装软件包。 这可能意味着你的/etc/apt/sources.list文件的引用是stable而不是sarge (即你正在从当前最新的稳定版本中取得软件包,而不是你已经安装的版本)。
尝试编辑/etc/apt/sources.list ,用sargereplace所有对stable的引用。 例如,一条线如:
deb http://ftp.uk.debian.org/debian/ stable main non-free contrib
应该成为:
deb http://ftp.uk.debian.org/debian/ sarge main non-free contrib
运行aptitude update ,然后你就可以从sarge升级到最新的软件包。
但是,Sarge于2008年3月31日被取消了 ,所以最好把机器升级到Lenny。 由于Lenny是自Sarge以来发布的第二个主要版本,因此首先升级到中间版本Etch可能会更容易。 请参阅Etch和Lenny发行说明的第4部分,了解如何执行此操作的详细信息。 在开始之前,确保你有一个可行的备份也是值得的,以防出现问题。
我有一个想法,但它可能导致破损的包,所以先备份,或在其他机器上尝试:
您可以使用选项--force-depends选项,通过dpkg来安装软件包,将所有相关性问题转化为警告。
我用它来安装一个打印机驱动程序,它工作正常 – 因为技术上,一切安装正确。 唯一的问题是,能力报告事后报道。 我不知道,如何解决它们(和打印机驱动程序是不够重要的投入大量的时间,所以我只是卸载它)。