Apt-get 问题,无法安装任何东西

Apt-get 问题,无法安装任何东西

我一直尝试安装一些软件包,但不断收到与linux-generic和有关的错误linux-image-generic

运行时apt-get -f install这是输出,任何帮助都将不胜感激:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-generic linux-image-generic
The following packages will be upgraded:
  linux-generic linux-image-generic
2 upgraded, 0 newly installed, 0 to remove and 322 not upgraded.
2 not fully installed or removed.
Need to get 0 B/4,344 B of archives.
After this operation, 2,048 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-84-generic; however:
  Package linux-image-3.2.0-84-generic is not installed.
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.84.98); however:
  Package linux-image-generic is not configured yet.
 linux-generic depends on linux-headers-generic (= 3.2.0.84.98); however:
  Version of linux-headers-generic on system is 3.2.0.126.141.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports has already been reached
No apport 
report written because MaxReports has already been reached
Errors were encountered while processing:
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

fkraiem 的输出apt-cache policy linux-generic linux-image-generic是:

  linux-generic:
      Installed: 3.2.0.84.98
      Candidate: 3.2.0.126.141
      Version table:
         3.2.0.126.141 0
            500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     *** 3.2.0.84.98 0
            100 /var/lib/dpkg/status
         3.2.0.23.25 0
            500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
    linux-image-generic:
      Installed: 3.2.0.84.98
      Candidate: 3.2.0.126.141
      Version table:
         3.2.0.126.141 0
            500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     *** 3.2.0.84.98 0
            100 /var/lib/dpkg/status
         3.2.0.23.25 0
            500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Elder Geek 的输出dpkg --configure -a为:

dpkg: dependency problems prevent configuration of linux-image-generic:
     linux-image-generic depends on linux-image-3.2.0-84-generic; however:
      Package linux-image-3.2.0-84-generic is not installed.
    dpkg: error processing linux-image-generic (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of linux-generic:
     linux-generic depends on linux-image-generic (= 3.2.0.84.98); however:
      Package linux-image-generic is not configured yet.
     linux-generic depends on linux-headers-generic (= 3.2.0.84.98); however:
      Version of linux-headers-generic on system is 3.2.0.126.141.
    dpkg: error processing linux-generic (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     linux-image-generic
     linux-generic

答案1

当内核和 linux-firmware 软件包过期时,我在 RHEL 系统上也遇到了类似的依赖问题。你最近更新/升级过你的 Ubuntu 安装吗?如果没有,

sudo apt update && apt upgrade

足以让您的系统保持最新状态;一旦完成,请重新启动系统并再次尝试安装。

答案2

来自的建议Noisy_Botnet关联(在他们的文章中提到)评论)似乎解决了这个问题:

sudo dpkg -r linux-generic linux-image-generic
sudo apt-get install linux-generic

相关内容