AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 883580
Accepted
MohammedSimba
MohammedSimba
Asked: 2017-02-16 03:19:07 +0800 CST2017-02-16 03:19:07 +0800 CST 2017-02-16 03:19:07 +0800 CST

apt-get:无法安装或升级任何软件包 [重复]

  • 772
这个问题在这里已经有了答案:
我的 /boot 分区达到 100%,现在我无法升级。无法移除旧内核以腾出空间 18 个答案
如何在 /boot 中释放更多空间? (23 个回答)
5年前关闭。

我正在使用 Ubuntu 12.04。我无法安装或升级我拥有的任何软件包:

apt-get install traceroute
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:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

如果我尝试-f,我被告知/boot已满:

apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.2.0-74 linux-image-3.2.0-74-generic linux-headers-3.2.0-74-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-generic linux-headers-generic linux-image-3.2.0-121-generic linux-image-generic
Suggested packages:
  fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.2.0-121-generic
The following packages will be upgraded:
  linux-generic linux-headers-generic linux-image-generic
3 upgraded, 1 newly installed, 0 to remove and 203 not upgraded.
10 not fully installed or removed.
Need to get 0 B/38.8 MB of archives.
After this operation, 151 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
........
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during `./boot/vmlinuz-3.2.0-121-generic': No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我的/boot尺码:

/dev/sda1        92M   85M  1.9M  98% /boot

ls -ll
total 76775
-rw------- 1 root root  2884358 Apr 11  2012 System.map-3.2.0-23-generic
-rw------- 1 root root  2897962 Dec  9  2014 System.map-3.2.0-74-generic
-rw------- 1 root root  2898003 Dec 16  2014 System.map-3.2.0-75-generic
-rw------- 1 root root  2898466 Jan 13  2015 System.map-3.2.0-76-generic
-rw-r--r-- 1 root root   791023 Apr 11  2012 abi-3.2.0-23-generic
-rw-r--r-- 1 root root   796535 Dec  9  2014 abi-3.2.0-74-generic
-rw-r--r-- 1 root root   796535 Dec 16  2014 abi-3.2.0-75-generic
-rw-r--r-- 1 root root   796597 Jan 13  2015 abi-3.2.0-76-generic
-rw-r--r-- 1 root root   140279 Apr 11  2012 config-3.2.0-23-generic
-rw-r--r-- 1 root root   140790 Dec  9  2014 config-3.2.0-74-generic
-rw-r--r-- 1 root root   140790 Dec 16  2014 config-3.2.0-75-generic
-rw-r--r-- 1 root root   140790 Jan 13  2015 config-3.2.0-76-generic
drwxr-xr-x 3 root root     7168 Feb  1  2015 grub
-rw-r--r-- 1 root root 14177627 Apr  9  2014 initrd.img-3.2.0-23-generic
-rw-r--r-- 1 root root 14232258 Dec 11  2014 initrd.img-3.2.0-74-generic
-rw-r--r-- 1 root root 14233553 Feb  1  2015 initrd.img-3.2.0-75-generic
drwx------ 2 root root    12288 Nov 21  2013 lost+found
-rw-r--r-- 1 root root   176764 Nov 27  2011 memtest86+.bin
-rw-r--r-- 1 root root   178944 Nov 27  2011 memtest86+_multiboot.bin
-rw------- 1 root root  4965840 Apr 11  2012 vmlinuz-3.2.0-23-generic
-rw------- 1 root root  4990768 Dec  9  2014 vmlinuz-3.2.0-74-generic
-rw------- 1 root root  4991088 Dec 16  2014 vmlinuz-3.2.0-75-generic
-rw------- 1 root root  4991856 Jan 13  2015 vmlinuz-3.2.0-76-generic

我在这里尝试了解决方案和其他清除旧内核解决方案,但出现以下错误:

$ uname -r
3.2.0-75-generic

$dpkg --list 'linux-image*' | grep ^ii
ii  linux-image-3.2.0-23-generic     3.2.0-23.36                         Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-74-generic     3.2.0-74.109                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-75-generic     3.2.0-75.110                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP

$ apt-get remove linux-image-3.2.0-74-generic 
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:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

请问有什么帮助吗?

编辑:

我在这里尝试了解决方案并手动删除了旧内核,但现在我遇到了一个不同的依赖问题:

apt-get install -f
......

Generating grub.cfg ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.2.0-121-generic
Found initrd image: /boot/initrd.img-3.2.0-121-generic
Found linux image: /boot/vmlinuz-3.2.0-76-generic
Found initrd image: /boot/initrd.img-3.2.0-76-generic
Found linux image: /boot/vmlinuz-3.2.0-75-generic
Found initrd image: /boot/initrd.img-3.2.0-75-generic
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-generic (3.2.0.121.136) ...
Setting up linux-headers-generic (3.2.0.121.136) ...
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.76.90); however:
  Version of linux-image-generic on system is 3.2.0.121.136.
 linux-generic depends on linux-headers-generic (= 3.2.0.76.90); however:
  Version of linux-headers-generic on system is 3.2.0.121.136.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

并且当前内核仍然是“3.2.0-75-generic”

12.04
  • 1 1 个回答
  • 732 Views

1 个回答

  • Voted
  1. Best Answer
    MohammedSimba
    2017-02-17T04:12:49+08:002017-02-17T04:12:49+08:00

    我使用了这个问题,因为由于某些不正确的内核升级而导致缺少依赖项,我无法安装任何软件包,而且我/boot几乎已满,我不得不手动删除旧的内核版本并保留最后一个:

    rm vmlinuz-3.2.0-xx-generic abi-3.2.0-xx-generic config-3.2.0-xx-generic initrd.img-3.2.0-xx-generic System.map-3.2.0-xx-generic
    

    手动删除文件不是最佳实践解决方案,但我无法使用 APT 或dpkg.

    然后我跑去apt-get install -f修复丢失的依赖项并完全安装新内核,但后来我得到了错误:

    dpkg: dependency problems prevent configuration of linux-generic:
     linux-generic depends on linux-image-generic (= 3.2.0.76.90); however:
      Version of linux-image-generic on system is 3.2.0.121.136.
     linux-generic depends on linux-headers-generic (= 3.2.0.76.90); however:
      Version of linux-headers-generic on system is 3.2.0.121.136.
    dpkg: error processing linux-generic (--configure):
     dependency problems - leaving unconfigured
    No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                              Errors were encountered while processing:
     linux-generic
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    然后我切换到这个有同样问题的问题并尝试重新安装内核:

    apt-get install --reinstall linux-generic=3.2.0.121.136 -f
    

    但我也有同样的问题,

    所以我尝试使用dpkg:

    # ls /var/cache/apt/archives/linux-generic*
    /var/cache/apt/archives/linux-generic_3.2.0.121.136_amd64.deb
    
    # dpkg --install /var/cache/apt/archives/linux-generic_3.2.0.121.136_amd64.deb
    (Reading database ... 860860 files and directories currently installed.)
    Preparing to replace linux-generic 3.2.0.121.136 (using .../linux-generic_3.2.0.121.136_amd64.deb) ...
    Unpacking replacement linux-generic ...
    Setting up linux-generic (3.2.0.121.136) ...
    
    # apt-get -f install
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
    

    一切正常,

    感谢每条评论让我将所有这些帖子结合在一起以解决我的问题@Pilot6、@muru 和 @user535733

    • 2

相关问题

  • 跨(全屏)应用程序拖放,通过 Alt-Tab 切换

  • Guake 终端在 Unity 中显示错误

  • 字体损坏:通过字符的行

  • 使用活动应用程序自动切换到工作区

  • 如何查看实际内存及其属性(插槽位置、大小、速度...)

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve