我如何修复 dpkg 和 apt-get?

我如何修复 dpkg 和 apt-get?

每次我这样做:

sudo apt-get update && sudo apt-get upgrade

我最终得到了所有这些错误报告:

Ign http://nl.archive.ubuntu.com trusty InRelease
Ign http://extras.ubuntu.com trusty InRelease                                  
Ign http://nl.archive.ubuntu.com trusty-updates InRelease                      
Get:1 http://extras.ubuntu.com trusty Release.gpg [72 B]                       
Ign http://nl.archive.ubuntu.com trusty-backports InRelease                    
Get:2 http://extras.ubuntu.com trusty Release [11,9 kB]                        
Get:3 http://nl.archive.ubuntu.com trusty Release.gpg [933 B]                  
Get:4 http://nl.archive.ubuntu.com trusty-updates Release.gpg [933 B]          
Get:5 http://extras.ubuntu.com trusty/main Sources [14 B]                      
Get:6 http://nl.archive.ubuntu.com trusty-backports Release.gpg [933 B]        
Get:7 http://nl.archive.ubuntu.com trusty Release [58,5 kB]                    
Get:8 http://extras.ubuntu.com trusty/main amd64 Packages [14 B]               
Ign http://archive.canonical.com trusty InRelease                              
Get:9 http://extras.ubuntu.com trusty/main i386 Packages [14 B]                
Get:10 http://nl.archive.ubuntu.com trusty-updates Release [62,0 kB]           
Get:11 http://archive.canonical.com trusty Release.gpg [933 B]                 
Get:12 http://nl.archive.ubuntu.com trusty-backports Release [62,0 kB]         
Get:13 http://nl.archive.ubuntu.com trusty/main Sources [1064 kB]              
Get:14 http://archive.canonical.com trusty Release [9359 B]                    
Ign http://security.ubuntu.com trusty-security InRelease                       
Ign http://extras.ubuntu.com trusty/main Translation-en_US                     
Get:15 http://archive.canonical.com trusty/partner Sources [7939 B]            
Ign http://extras.ubuntu.com trusty/main Translation-en                        
Get:16 http://security.ubuntu.com trusty-security Release.gpg [933 B]          
Get:17 http://archive.canonical.com trusty/partner amd64 Packages [4877 B]     
Get:18 http://archive.canonical.com trusty/partner i386 Packages [5559 B]      
Get:19 http://archive.canonical.com trusty/partner Translation-en [3919 B]     
Get:20 http://security.ubuntu.com trusty-security Release [62,0 kB]            
Get:21 http://nl.archive.ubuntu.com trusty/restricted Sources [5433 B]
Get:22 http://nl.archive.ubuntu.com trusty/universe Sources [6399 kB]          
Get:23 http://security.ubuntu.com trusty-security/main Sources [53,6 kB]       
Get:24 http://security.ubuntu.com trusty-security/restricted Sources [14 B]    
Get:25 http://security.ubuntu.com trusty-security/universe Sources [17,4 kB]   
Get:26 http://security.ubuntu.com trusty-security/multiverse Sources [700 B]   
Get:27 http://security.ubuntu.com trusty-security/main amd64 Packages [166 kB] 
Get:28 http://nl.archive.ubuntu.com trusty/multiverse Sources [174 kB]         
Get:29 http://nl.archive.ubuntu.com trusty/main amd64 Packages [1350 kB]       
Get:30 http://nl.archive.ubuntu.com trusty/restricted amd64 Packages [13,0 kB] 
Get:31 http://nl.archive.ubuntu.com trusty/universe amd64 Packages [5859 kB]   
Get:32 http://nl.archive.ubuntu.com trusty/multiverse amd64 Packages [132 kB]  
Get:33 http://nl.archive.ubuntu.com trusty/main i386 Packages [1348 kB]        
Get:34 http://nl.archive.ubuntu.com trusty/restricted i386 Packages [13,4 kB]  
Get:35 http://nl.archive.ubuntu.com trusty/universe i386 Packages [5866 kB]    
Get:36 http://security.ubuntu.com trusty-security/restricted amd64 Packages [14 B]
Get:37 http://security.ubuntu.com trusty-security/universe amd64 Packages [73,0 kB]
Get:38 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [1144 B]
Get:39 http://security.ubuntu.com trusty-security/main i386 Packages [158 kB]  
Get:40 http://security.ubuntu.com trusty-security/restricted i386 Packages [14 B]
Get:41 http://security.ubuntu.com trusty-security/universe i386 Packages [73,2 kB]
Get:42 http://security.ubuntu.com trusty-security/multiverse i386 Packages [1389 B]
Get:43 http://security.ubuntu.com trusty-security/main Translation-en [81,7 kB]
Get:44 http://security.ubuntu.com trusty-security/multiverse Translation-en [587 B]
Get:45 http://security.ubuntu.com trusty-security/restricted Translation-en [14 B]
Get:46 http://security.ubuntu.com trusty-security/universe Translation-en [39,9 kB]
Get:47 http://nl.archive.ubuntu.com trusty/multiverse i386 Packages [134 kB]   
Get:48 http://nl.archive.ubuntu.com trusty/main Translation-en [762 kB]        
Get:49 http://nl.archive.ubuntu.com trusty/multiverse Translation-en [102 kB]  
Get:50 http://nl.archive.ubuntu.com trusty/restricted Translation-en [3457 B]  
Get:51 http://nl.archive.ubuntu.com trusty/universe Translation-en [4089 kB]   
Get:52 http://nl.archive.ubuntu.com trusty-updates/main Sources [144 kB]       
Get:53 http://nl.archive.ubuntu.com trusty-updates/restricted Sources [1408 B] 
Get:54 http://nl.archive.ubuntu.com trusty-updates/universe Sources [92,8 kB]  
Get:55 http://nl.archive.ubuntu.com trusty-updates/multiverse Sources [3534 B] 
Get:56 http://nl.archive.ubuntu.com trusty-updates/main amd64 Packages [371 kB]
Get:57 http://nl.archive.ubuntu.com trusty-updates/restricted amd64 Packages [5820 B]
Get:58 http://nl.archive.ubuntu.com trusty-updates/universe amd64 Packages [222 kB]
Get:59 http://nl.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [9359 B]
Get:60 http://nl.archive.ubuntu.com trusty-updates/main i386 Packages [363 kB] 
Get:61 http://nl.archive.ubuntu.com trusty-updates/restricted i386 Packages [5820 B]
Get:62 http://nl.archive.ubuntu.com trusty-updates/universe i386 Packages [222 kB]
Get:63 http://nl.archive.ubuntu.com trusty-updates/multiverse i386 Packages [9567 B]
Get:64 http://nl.archive.ubuntu.com trusty-updates/main Translation-en [170 kB]
Get:65 http://nl.archive.ubuntu.com trusty-updates/multiverse Translation-en [4719 B]
Get:66 http://nl.archive.ubuntu.com trusty-updates/restricted Translation-en [1736 B]
Get:67 http://nl.archive.ubuntu.com trusty-updates/universe Translation-en [112 kB]
Get:68 http://nl.archive.ubuntu.com trusty-backports/main Sources [4060 B]     
Get:69 http://nl.archive.ubuntu.com trusty-backports/restricted Sources [14 B] 
Get:70 http://nl.archive.ubuntu.com trusty-backports/universe Sources [17,6 kB]
Get:71 http://nl.archive.ubuntu.com trusty-backports/multiverse Sources [1883 B]
Get:72 http://nl.archive.ubuntu.com trusty-backports/main amd64 Packages [4915 B]
Get:73 http://nl.archive.ubuntu.com trusty-backports/restricted amd64 Packages [14 B]
Get:74 http://nl.archive.ubuntu.com trusty-backports/universe amd64 Packages [19,8 kB]
Get:75 http://nl.archive.ubuntu.com trusty-backports/multiverse amd64 Packages [1231 B]
Get:76 http://nl.archive.ubuntu.com trusty-backports/main i386 Packages [4935 B]
Get:77 http://nl.archive.ubuntu.com trusty-backports/restricted i386 Packages [14 B]
Get:78 http://nl.archive.ubuntu.com trusty-backports/universe i386 Packages [19,9 kB]
Get:79 http://nl.archive.ubuntu.com trusty-backports/multiverse i386 Packages [1235 B]
Get:80 http://nl.archive.ubuntu.com trusty-backports/main Translation-en [2890 B]
Get:81 http://nl.archive.ubuntu.com trusty-backports/multiverse Translation-en [776 B]
Get:82 http://nl.archive.ubuntu.com trusty-backports/restricted Translation-en [14 B]
Get:83 http://nl.archive.ubuntu.com trusty-backports/universe Translation-en [17,1 kB]
Ign http://nl.archive.ubuntu.com trusty/main Translation-en_US                 
Ign http://nl.archive.ubuntu.com trusty/multiverse Translation-en_US           
Ign http://nl.archive.ubuntu.com trusty/restricted Translation-en_US           
Ign http://nl.archive.ubuntu.com trusty/universe Translation-en_US             
Fetched 30,1 MB in 42s (706 kB/s)                                              
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  liboxideqt-qmlplugin libqt5gui5 linux-generic linux-headers-generic
  linux-image-generic
The following packages will be upgraded:
  account-plugin-aim account-plugin-jabber account-plugin-salut
  account-plugin-yahoo accountsservice app-install-data apparmor apport
  apport-gtk apt apt-transport-https apt-utils aptdaemon aptdaemon-data
  base-files bash bsdutils compiz compiz-core compiz-gnome
  compiz-plugins-default cups cups-browsed cups-bsd cups-client cups-common
  cups-core-drivers cups-daemon cups-filters cups-filters-core-drivers
  cups-ppdc cups-server-common dbus dbus-x11 dpkg duplicity empathy
  empathy-common evince evince-common evolution-data-server
  evolution-data-server-common evolution-data-server-online-accounts file
  file-roller firefox fontconfig fontconfig-config fonts-droid
  fonts-opensymbol gcc-4.9-base gdb gettext gettext-base ghostscript
  ghostscript-x gir1.2-appindicator3-0.1 gir1.2-dbusmenu-glib-0.4
  gir1.2-ebook-1.2 gir1.2-ebookcontacts-1.2 gir1.2-edataserver-1.2
  gir1.2-freedesktop gir1.2-glib-2.0 gir1.2-gnomebluetooth-1.0
  gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-gtk-3.0
  gir1.2-gudev-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-pango-1.0 gir1.2-rb-3.0
  gir1.2-webkit-3.0 gnome-bluetooth gnome-calculator
  gnome-control-center-shared-data gnome-keyring gnome-settings-daemon-schemas
  gnome-sudoku gnupg gpgv grub-common grub-pc grub-pc-bin grub2-common
  gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps
  gstreamer1.0-plugins-good gstreamer1.0-pulseaudio gstreamer1.0-tools
  gstreamer1.0-x hardening-includes hplip hplip-data hud ifupdown im-config
  indicator-printers initramfs-tools initramfs-tools-bin intel-gpu-tools
  iputils-arping iputils-ping iputils-tracepath irqbalance krb5-locales
  language-selector-common language-selector-gnome libaccountsservice0
  libapparmor-perl libapparmor1 libappindicator3-1 libapt-inst1.5
  libapt-pkg4.12 libasprintf-dev libasprintf0c2 libblkid1
  libboost-date-time1.54.0 libboost-system1.54.0 libc-bin libc-dev-bin libc6
  libc6-dbg libc6-dev libcamel-1.2-45 libcgmanager0 libcompizconfig0 libcups2
  libcupscgi1 libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libcurl3
  libcurl3-gnutls libdbus-1-3 libdbusmenu-glib4 libdbusmenu-gtk3-4
  libdbusmenu-gtk4 libdecoration0 libdpkg-perl libebackend-1.2-7
  libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-16 libedata-book-1.2-20
  libedata-cal-1.2-23 libedataserver-1.2-18 libegl1-mesa libegl1-mesa-drivers
  libelf1 libevdocument3-4 libevview3-3 libflac8 libfontconfig1 libfontembed1
  libfreetype6 libgail-3-0 libgail-common libgail18 libgbm1 libgcc1
  libgcrypt11 libgettextpo-dev libgettextpo0 libgexiv2-2 libgirepository-1.0-1
  libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgles2-mesa libglib2.0-0
  libglib2.0-bin libglib2.0-data libgnome-bluetooth11 libgnome-control-center1
  libgnutls-openssl27 libgnutls26 libgpgme11 libgphoto2-6 libgphoto2-l10n
  libgphoto2-port10 libgs9 libgs9-common libgssapi-krb5-2
  libgstreamer-plugins-base1.0-0 libgstreamer-plugins-good1.0-0
  libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin libgtk-3-common libgtk2.0-0
  libgtk2.0-bin libgtk2.0-common libgudev-1.0-0 libgweather-3-6
  libgweather-common libharfbuzz-icu0 libharfbuzz0b libhpmud0 libhud2
  libido3-0.1-0 libindicator3-7 libjavascriptcoregtk-3.0-0 libjbig0 libjson-c2
  libjson0 libk5crypto3 libkrb5-3 libkrb5support0 liblightdm-gobject-1-0
  liblzo2-2 libmagic1 libminiupnpc8 libmount1 libnautilus-extension1a
  libnm-gtk-common libnm-gtk0 libnspr4 libnss3 libnss3-nssdb libnux-4.0-0
  libnux-4.0-common libopenvg1-mesa libp11-kit-gnome-keyring
  libpam-gnome-keyring libpam-systemd libpango-1.0-0 libpango1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpoppler-glib8
  libpoppler44 libpurple-bin libpurple0 libqt5core5a libqt5dbus5
  libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5qml5 libqt5quick5
  libqt5sql5 libqt5sql5-sqlite libqt5test5 libqt5widgets5 libqt5xml5
  libreoffice-avmedia-backend-gstreamer libreoffice-ogltrans
  libreoffice-pdfimport libreoffice-presentation-minimizer
  libreoffice-style-human librhythmbox-core8 libsane libsane-common
  libsane-hpaio libselinux1 libsmbclient libspectre1 libssl1.0.0
  libsystemd-daemon0 libsystemd-journal0 libsystemd-login0 libtasn1-6 libtiff5
  libudev1 libunity-control-center1 libunity-core-6.0-9 libunity-gtk2-parser0
  libunity-gtk3-parser0 libupstart1 libuuid1 libvncserver0
  libwayland-egl1-mesa libwbclient0 libwebkitgtk-3.0-0 libwebkitgtk-3.0-common
  libwhoopsie0 libxatracker2 libxfont1 libxml2 lightdm linux-firmware
  linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
  linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic
  linux-libc-dev locales lshw ltrace man-db mcp-account-manager-uoa mount
  multiarch-support nautilus nautilus-data nautilus-sendto-empathy net-tools
  network-manager-gnome nux-tools openssh-client openssl patch pm-utils
  poppler-utils ppp printer-driver-hpcups printer-driver-postscript-hp
  python-aptdaemon python-aptdaemon.gtk3widgets python-cupshelpers python-gi
  python-gi-cairo python-gobject python-libxml2 python-lxml python-pexpect
  python-samba python3-apport python3-aptdaemon python3-aptdaemon.gtk3widgets
  python3-aptdaemon.pkcompat python3-distupgrade python3-gi python3-gi-cairo
  python3-lxml python3-problem-report python3-requests
  python3-software-properties python3-update-manager
  qtdeclarative5-dialogs-plugin qtdeclarative5-localstorage-plugin
  qtdeclarative5-privatewidgets-plugin qtdeclarative5-qtquick2-plugin
  qtdeclarative5-ubuntu-ui-extras-browser-plugin
  qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets
  qtdeclarative5-window-plugin resolvconf rhythmbox rhythmbox-data
  rhythmbox-mozilla rhythmbox-plugin-cdrecorder rhythmbox-plugin-magnatune
  rhythmbox-plugin-zeitgeist rhythmbox-plugins rsync rsyslog samba-common
  samba-common-bin samba-libs sane-utils shotwell shotwell-common simple-scan
  smbclient software-center software-properties-common software-properties-gtk
  ssh-askpass-gnome system-config-printer-common system-config-printer-gnome
  system-config-printer-udev systemd-services tcpdump telepathy-gabble
  transmission-common transmission-gtk tzdata ubuntu-docs
  ubuntu-drivers-common ubuntu-release-upgrader-core
  ubuntu-release-upgrader-gtk udev unity unity-control-center unity-greeter
  unity-gtk-module-common unity-gtk2-module unity-gtk3-module unity-services
  unity-settings-daemon uno-libs3 update-manager update-manager-core
  update-notifier update-notifier-common upstart ure usb-creator-common
  usb-creator-gtk util-linux uuid-runtime webapp-container webbrowser-app wget
  whoopsie wpasupplicant xdg-utils xserver-common xserver-xorg-core
  xserver-xorg-video-ati xserver-xorg-video-intel xserver-xorg-video-radeon
  xul-ext-ubufox xul-ext-websites-integration
407 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/268 MB of archives.
After this operation, 35,5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Extracting templates from packages: 29%E: Sub-process gzip returned an error code (1)
E: Prior errors apply to /var/cache/apt/archives/unity-settings-daemon_14.04.0+14.04.20140606-0ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libglib2.0-bin_2.40.2-0ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libglib2.0-0_2.40.2-0ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/python3-gi-cairo_3.12.0-1ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/python3-gi_3.12.0-1ubuntu1_amd64.deb
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 44%E: Sub-process gzip returned an error code (1)
E: Prior errors apply to /var/cache/apt/archives/libqt5xml5_5.2.1+dfsg-1ubuntu14.2_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libspectre1_0.2.7-2ubuntu1.1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libunity-gtk2-parser0_0.0.0+14.04.20140403-0ubuntu2_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libunity-gtk3-parser0_0.0.0+14.04.20140403-0ubuntu2_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libupstart1_1.12.1-0ubuntu4.2_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libvncserver0_0.9.9+dfsg-1ubuntu1.1_amd64.deb
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 66%E: Sub-process gzip returned an error code (1)
E: Prior errors apply to /var/cache/apt/archives/libevview3-3_3.10.3-0ubuntu10.1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/evince-common_3.10.3-0ubuntu10.1_all.deb
E: Prior errors apply to /var/cache/apt/archives/evolution-data-server-online-accounts_3.10.4-0ubuntu1.5_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/evolution-data-server_3.10.4-0ubuntu1.5_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/libcamel-1.2-45_3.10.4-0ubuntu1.5_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/evolution-data-server-common_3.10.4-0ubuntu1.5_all.deb
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 88%^[[AE: Sub-process gzip returned an error code (1)
E: Prior errors apply to /var/cache/apt/archives/python3-lxml_3.3.3-1ubuntu0.1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/python3-requests_2.2.1-1ubuntu0.1_all.deb
E: Prior errors apply to /var/cache/apt/archives/software-properties-common_0.92.37.2_all.deb
E: Prior errors apply to /var/cache/apt/archives/software-properties-gtk_0.92.37.2_all.deb
E: Prior errors apply to /var/cache/apt/archives/python3-software-properties_0.92.37.2_all.deb
E: Prior errors apply to /var/cache/apt/archives/webapp-container_0.23+14.04.20140428-0ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/qtdeclarative5-ubuntu-ui-extras-browser-plugin_0.23+14.04.20140428-0ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/webbrowser-app_0.23+14.04.20140428-0ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets_0.23+14.04.20140428-0ubuntu1_all.deb
E: Prior errors apply to /var/cache/apt/archives/sane-utils_1.0.23-3ubuntu3.1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/shotwell-common_0.18.0-0ubuntu4.3_all.deb
E: Prior errors apply to /var/cache/apt/archives/shotwell_0.18.0-0ubuntu4.3_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/xdg-utils_1.1.0~rc1-2ubuntu7.1_all.deb
E: Prior errors apply to /var/cache/apt/archives/simple-scan_3.12.1-0ubuntu1_amd64.deb
E: Prior errors apply to /var/cache/apt/archives/python-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.1_all.deb
E: Prior errors apply to /var/cache/apt/archives/python-aptdaemon_1.1.1-1ubuntu5.1_all.deb
E: Prior errors apply to /var/cache/apt/archives/software-center_13.10-0ubuntu4.1_all.deb
E: Prior errors apply to /var/cache/apt/archives/ssh-askpass-gnome_1%3a6.6p1-2ubuntu2_amd64.deb
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 100%
Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'language-pack-gnome-en-base': Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

我该如何解决这个问题?

答案1

同意 Klaus 的评论,

这可能是文件系统损坏,与 dpkg 或 apt 程序无关,您可以通过在系统上运行以下命令来检查文件系统是否存在任何损坏。

fsck /dev/sdb#

'# 必须替换为您的卷 ID'

您可以通过运行以下命令来获取卷 ID。

fdisk -l |grep "/dev"

希望这会有所帮助。

相关内容