已经尝试过的办法:
sudo apt-get clean
sudo apt-get update
sudo apt-get dist-upgrade
sudo dpkg --configure -a
错误代码如下:
root@AY120829101409b481935:~# sudo apt-get install php5 Reading package lists... Done Building dependency tree Reading state information... Done php5 is already the newest version. The following package was automatically installed and is no longer required: python-support Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 36 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y Setting up udev (173-0ubuntu4.3) ... udev start/running, process 7654 info: unrecognized option '--convert-db' dpkg: error processing udev (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of dmsetup: dmsetup depends on udev (>> 141-2); however: Package udev is not configured yet. dpkg: error processing dmsetup (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libdevmapper1.02.1: libdevmapper1.02.1 depends on dmsetup (>= 2:1.02.48-4ubuntu3); however: Package dmsetup is not configured yet. dpkg: error processing libdevmapper1.02.1 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of plymouth: plymouth depends on udev (>= 166-0ubuntu4); however: Package udev is not configured yet. dpkg: error processing plymouth (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of mountall: mountall depends onNo apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already udev; however: Package udev is not configured yet. mountall depends on plymouth; however: Package plymouth is not configured yet. dpkg: error processing mountall (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of initscripts: initscripts depends on mountall (>= 2.28); however: Package mountall is not configured yet. dpkg: error processing initscripts (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of netbase: netbase depends on initscripts; however: Package initscripts is not configured yet. dpkg: error processing netbase (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ntpdate: ntpdate depends on netbase; however: Package netbase is not configured yet. dpkg: error processing ntpdate (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ntfs-3No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already g: ntfs-3g depends on initscripts (>= 2.88dsf-13.3); however: Package initscripts is not configured yet. dpkg: error processing ntfs-3g (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of wireless-crda: wireless-crda depends on udev; however: Package udev is not configured yet. dpkg: error processing wireless-crda (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-image-3.0.0-26-server: linux-image-3.0.0-26-server depends on wireless-crda; however: Package wireless-crda is not configured yet. dpkg: error processing linux-image-3.0.0-26-server (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ntp: ntp depends on netbase; however: Package netbase is not configured yet. dpkg: error processing ntp (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configurationNo apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already of eject: eject depends on libdevmapper1.02.1 (>= 2:1.02.20); however: Package libdevmapper1.02.1 is not configured yet. dpkg: error processing eject (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ifupdown: ifupdown depends on initscripts (>= 2.88dsf-13.3); however: Package initscripts is not configured yet. dpkg: error processing ifupdown (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ubuntu-minimal: ubuntu-minimal depends on eject; however: Package eject is not configured yet. ubuntu-minimal depends on ifupdown; however: Package ifupdown is not configured yet. ubuntu-minimal depends on netbase; however: Package netbase is not configured yet. ubuntu-minimal depends on ntpdate; however: Package ntpdate is not configured yet. ubuntu-minimal depends on udev; however: Package udev is not configured yet. dpkg: error processing ubuntu-minimal (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of dbus: dbus depends on netbase (>= 4.45ubuntu3); however: Package netbase is not configured yet. dpkg: error processing dbus (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ftp: ftp depends on netbase; however: Package netbase is not configured yet. dpkg: error processing ftp (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of accountsservice: accountsservice depends on dbus; however: Package dbus is not configured yet. dpkg: error processing accountsservice (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of language-selector-common: language-selector-common depends on dbus; however: Package dbus is not configured yet. language-selector-common depends on accountsservice (>= 0.6.13-1ubuntu2); however: Package accountsservice is not configured yet. dpkg: error processing language-selector-common (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libparted0debian1: libparted0debian1 depends on libdevmapper1.02.1 (>= 2:1.02.36); however: Package libdevmapper1.02.1 is not configured yet. dpkg: error processing libparted0debian1 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of parted: parted depends on libparted0debian1 (>= 2.2-1); however: Package libparted0debian1 is not configured yet. dpkg: error processing parted (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of plymouth-theme-ubuntu-text: plymouth-theme-ubuntu-text depends on plymouth; however: Package plymouth is not configured yet. dpkg: error processing plymouth-theme-ubuntu-text (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ubuntu-standard: ubuntu-standard depends on ftp; however: Package ftp is not configured yet. ubuntu-standard depends on language-selector-common; however: Package language-selector-common is not configured yet. ubuntu-standard depends on parted; however: Package parted is not configured yet. dpkg: error processing ubuntu-standard (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libio-socket-ssl-perl: libio-socket-ssl-perl depends on netbase; however: Package netbase is not configured yet. dpkg: error processing libio-socket-ssl-perl (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libwww-perl: libwww-perl depends on netbase; however: Package netbase is not configured yet. dpkg: error processing libwww-perl (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of liblwp-protocol-https-perl: liblwp-protocol-https-perl depends on libwww-perl (>= 6.02); however: Package libwww-perl is not configured yet. liblwp-protocol-https-perl depends on libio-socket-ssl-perl; however: Package libio-socket-ssl-perl is not configured yet. dpkg: error processing liblwp-protocol-https-perl (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libxml-parser-perl: libxml-parser-perl depends on libwww-perl; however: Package libwww-perl is not configured yet. dpkg: error processing libxml-parser-perl (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of librpc-xml-perl: librpc-xml-perl depends on libwww-perl (>= 5.834); however: Package libwww-perl is not configured yet. librpc-xml-perl depends on libxml-parser-perl | libxml-libxml-perl (>= 1.70); however: Package libxml-parser-perl is not configured yet. Package libxml-libxml-perl is not installed. dpkg: error processing librpc-xml-perl (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of apparmor-utils: apparmor-utils depends on librpc-xml-perl; however: Package librpc-xml-perl is not configured yet. dpkg: error processing apparmor-utils (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of grub-common: grub-common depends on libdevmapper1.02.1 (>= 2:1.02.36); however: Package libdevmapper1.02.1 is not configured yet. dpkg: error processing grub-common (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of grub2-common: grub2-common depends on grub-common (= 1.99-12ubuntu5); however: Package grub-common is not configured yet. dpkg: error processing grub2-common (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of grub-pc-bin: grub-pc-bin depends on libdevmapper1.02.1 (>= 2:1.02.36); however: Package libdevmapper1.02.1 is not configured yet. grub-pc-bin depends on grub-common (= 1.99-12ubuntu5); however: Package grub-common is not configured yet. dpkg: error processing grub-pc-bin (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of grub-pc: grub-pc depends on grub-common; however: Package grub-common is not configured yet. grub-pc depends on grub2-common (= 1.99-12ubuntu5); however: Package grub2-common is not configured yet. grub-pc depends on grub-pc-bin (= 1.99-12ubuntu5); however: Package grub-pc-bin is not configured yet. dpkg: error processing grub-pc (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-image-server: linux-image-server depends on linux-image-3.0.0-26-server; however: Package linux-image-3.0.0-26-server is not configured yet. dpkg: error processing linux-image-server (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-server: linux-server depends on linux-image-server (= 3.0.0.26.30); however: Package linux-image-server is not configured yet. dpkg: error processing linux-server (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of grub-gfxpayload-lists: grub-gfxpayload-lists depends on grub-pc (>= 1.99~20101210-1ubuntu2); however: Package grub-pc is not configured yet. dpkg: error processing grub-gfxpayload-lists (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: udev dmsetup libdevmapper1.02.1 plymouth mountall initscripts netbase ntpdate ntfs-3g wireless-crda linux-image-3.0.0-26-server ntp eject ifupdown ubuntu-minimal dbus ftp accountsservice language-selector-common libparted0debian1 parted plymouth-theme-ubuntu-text ubuntu-standard libio-socket-ssl-perl libwww-perl liblwp-protocol-https-perl libxml-parser-perl librpc-xml-perl apparmor-utils grub-common grub2-common grub-pc-bin grub-pc linux-image-server linux-server grub-gfxpayload-lists E: Sub-process /usr/bin/dpkg returned an error code (1) root@AY120829101409b481935:~#
执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_old文件夹下
5.$ sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉
6.$ sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info //把以前的info文件夹重新改回名字