Dkpg 非常非常损坏,如何修复/从头开始?

Dkpg 非常非常损坏,如何修复/从头开始?

我正在使用 Ubuntu 10.04。我从之前负责管理这台机器的员工那里继承了这个设置,所以我无法告诉你导致这个问题的原因。

基本上,dpkg 不知何故无法正常工作,无法执行任何操作。因此,dpkg 的所有各种包装器也都失败了。让我们举一个非常简单的例子,例如apt-get install vim

apt-get install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
  adduser: Depends: perl-base (>= 5.6.0) but it is not going to be installed
           Depends: debconf but it is not going to be installed or
                    debconf-2.0
  bash-completion: Depends: bash (>= 3.1dfsg-9) but it is not going to be installed
  bsdmainutils: Depends: debianutils (>= 1.8) but it is not going to be installed
  ca-certificates: Depends: debconf (>= 0.5) but it is not going to be installed or
                            debconf-2.0
  cron: Depends: debianutils (>= 1.7) but it is not going to be installed
  debconf-i18n: Depends: debconf but it is not going to be installed
            Depends: liblocale-gettext-perl but it is not going to be installed
  gnupg: Depends: dpkg (>= 1.15.4) but it is not going to be installed or
                  install-info but it is not going to be installed
  ifupdown: Depends: debconf (>= 1.2.0) but it is not going to be installed or
                 debconf-2.0
  initramfs-tools: Depends: findutils (>= 4.2.24) but it is not going to be installed
                   Depends: util-linux (> 2.15~rc1) but it is not going to be installed
  initscripts: Depends: mount (>= 2.11x-1) but it is not going to be installed
               Depends: debianutils (>= 2.13.1) but it is not going to be installed
               Recommends: e2fsprogs but it is not going to be installed
  libc6: Depends: debconf (>= 0.5) but it is not going to be installed or
                  debconf-2.0
         Depends: findutils (>= 4.4.0-2ubuntu2) but it is not going to be installed
  libc6-dev: Depends: libc-dev-bin (= 2.11.1-0ubuntu7.12) but it is not going to be     installed
             Depends: linux-libc-dev but it is not going to be installed
             Recommends: gcc but it is not going to be installed or
                         c-compiler
  libgdbm3: Depends: dpkg (>= 1.15.4) but it is not going to be installed or
                     install-info but it is not going to be installed
  libhtml-parser-perl: Depends: perlapi-5.10.0
  libpam-runtime: Depends: debconf (>= 1.5.19) but it is not going to be installed
                  Depends: libpam-modules (>= 1.0.1-6) but it is not going to be installed
  libpam0g: Depends: debconf (>= 0.5) but it is not going to be installed or
                     debconf-2.0
  libssl0.9.8: Depends: debconf (>= 0.5) but it is not going to be installed or
                        debconf-2.0
  libtext-charwidth-perl: Depends: perl-base (>= 5.10.0-24ubuntu4) but it is not going     to be installed
                          Depends: perlapi-5.10.0
  libtext-iconv-perl: Depends: perl-base (>= 5.10.0-24ubuntu4) but it is not going to be installed
                      Depends: perlapi-5.10.0
  lsb-base: Depends: sed but it is not going to be installed
            Depends: ncurses-bin but it is not going to be installed
  mountall: Depends: coreutils (>= 7.1) but it is not going to be installed
  passwd: Depends: libpam-modules but it is not going to be installed
          Depends: debianutils (>= 2.15.2) but it is not going to be installed
  perl: Depends: perl-base (= 5.10.1-8ubuntu2.3) but it is not going to be installed
  python-minimal: Depends: dpkg (>= 1.13.20) but it is not going to be installed
  readline-common: Depends: dpkg (>= 1.15.4) but it is not going to be installed or
                            install-info but it is not going to be installed
  snort-rules-default: Depends: debconf (>= 0.2.80) but it is not going to be     installed or
                                debconf-2.0
  sysv-rc: Depends: debconf but it is not going to be installed or
                    debconf-2.0
  tzdata: Depends: debconf (>= 0.5) but it is not going to be installed or
                   debconf-2.0
  ucf: Depends: debconf (>= 1.5.19) but it is not going to be installed
       Depends: coreutils (>= 5.91) but it is not going to be installed
  udev: Depends: util-linux (> 2.15~rc2) but it is not going to be installed
  vim: Depends: vim-common (= 2:7.2.330-1ubuntu3.1) but it is not going to be installed
       Depends: vim-runtime (= 2:7.2.330-1ubuntu3.1) but it is not going to be     installed
       Depends: libpython2.6 (>= 2.6) but it is not going to be installed
  wget: Depends: dpkg (>= 1.15.4) but it is not going to be installed or
                 install-info but it is not going to be installed
  xml-core: Depends: sed (>= 4.1.2-8) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

是的,我确实尝试过apt-get if install,但不出所料,它没有起到什么作用

    apt-get 安装 -f
正在读取软件包列表...完成
构建依赖关系树       
正在读取状态信息...完成
纠正依赖关系...完成
将会安装以下额外的软件包:
  基础文件 bash coreutils dash debconf debianutils dpkg findutils gawk libc-dev-bin liblocale-gettext-perl libpam-modules linux-libc-dev manpages manpages-dev mount ncurses-bin perl-base sed util-linux
建议的软件包:
  bash-doc debconf-doc debconf-utils whiptail dialog gnome-utils libterm-readline-gnu-perl libgnome2-perl libnet-ldap-perl mlocate location slocate man-browser nfs-common util-linux-locales kbd console-tools
  工具
将会安装以下新软件包:
  基础文件 bash coreutils dash debconf debianutils dpkg findutils gawk libc-dev-bin liblocale-gettext-perl libpam-modules linux-libc-dev manpages manpages-dev mount ncurses-bin perl-base sed util-linux
升级了 0 个,新安装了 20 个,删除了 0 个,并且未升级 7 个。
150 未完全安装或删除。
需要获取 13.4MB 的档案。
此操作后将使用49.6MB的额外磁盘空间。
您想继续吗 [Y/n]?y
获取:1 http://mirrors.voxel.net/ubuntu/ lucid-updates/main coreutils 7.4-2ubuntu3 [2,907kB]
获取:2 http://mirrors.voxel.net/ubuntu/ lucid-updates/main dpkg 1.15.5.6ubuntu4.6 [2,252kB]
获取:3 http://mirrors.voxel.net/ubuntu/ lucid-updates/main perl-base 5.10.1-8ubuntu2.3 [1,084kB]
获取:4 http://mirrors.voxel.net/ubuntu/ lucid/main liblocale-gettext-perl 1.05-6 [22.0kB]
获取:5 http://mirrors.voxel.net/ubuntu/ lucid/main debconf 1.5.28ubuntu4 [148kB]
获取:6 http://mirrors.voxel.net/ubuntu/ lucid/main findutils 4.4.2-1ubuntu1 [480kB]
获取:7 http://mirrors.voxel.net/ubuntu/ lucid/main gawk 1:3.1.6.dfsg-4build1 [550kB]
获取:8 http://mirrors.voxel.net/ubuntu/ lucid-updates/main base-files 5.0.0ubuntu20.10.04.5 [70.3kB]
获取:9 http://mirrors.voxel.net/ubuntu/ lucid-updates/main libpam-modules 1.1.1-2ubuntu5.6 [392kB]
获取:10 http://mirrors.voxel.net/ubuntu/ lucid/main debianutils 3.2.2 [50.0kB]
获取:11 http://mirrors.voxel.net/ubuntu/ lucid-updates/main mount 2.17.2-0ubuntu1.10.04.2 [183kB]
获取:12 http://mirrors.voxel.net/ubuntu/ lucid/main sed 4.2.1-6 [180kB]
获取:13 http://mirrors.voxel.net/ubuntu/ lucid/main ncurses-bin 5.7+20090803-2ubuntu3 [312kB]
获取:14 http://mirrors.voxel.net/ubuntu/ lucid-updates/main util-linux 2.17.2-0ubuntu1.10.04.2 [572kB]
获取:15 http://mirrors.voxel.net/ubuntu/ lucid/main dash 0.5.5.1-3ubuntu2 [105kB]
获取:16 http://mirrors.voxel.net/ubuntu/ lucid/main bash 4.1-2ubuntu3 [702kB]
获取:17 http://mirrors.voxel.net/ubuntu/ lucid-updates/main libc-dev-bin 2.11.1-0ubuntu7.12 [225kB]
获取:18 http://mirrors.voxel.net/ubuntu/ lucid-updates/main linux-libc-dev 2.6.32-50.112 [870kB]
获取:19 http://mirrors.voxel.net/ubuntu/ lucid/main manpages 3.23-1 [716kB]
获取:20 http://mirrors.voxel.net/ubuntu/ lucid/main manpages-dev 3.23-1 [1,547kB]
1 秒内获取 13.4MB(8,720kB/s)   
E: 无法对已解压的“libattr1”执行立即配置。请参阅 APT::Immediate-Configure 下的 man 5 apt.conf 了解详情。

是的,我确实尝试过,apt-get install -o APT::Immediate-Configure=false -f但结果出现了错误:

E:无法为 liblocale-gettext-perl 配置预依赖的 perl-base,可能存在依赖循环。

是的,我尝试了所有方法apt-get clean apt-get autoclean apt-get updateapt-get upgrade都没有任何效果。

我还检查了 sources.list 文件并且它对于我的 ubuntu 版本来说看起来很健康。

我的观察:有些地方出了问题,因为它无法识别许多软件包已经安装。例如,Bash 肯定已经安装。perl 也是如此。adduser 也是如此……当我尝试使用 aptitude 来修复该问题时,aptitude 界面报告说它要安装的新安装的软件包之一是 aptitutde。无论如何,可以预见的是,aptitude 失败了。

那么我下一步该怎么做呢?

相关内容