Ubuntu 14.04 启动完全且更新不断安装旧内核

Ubuntu 14.04 启动完全且更新不断安装旧内核

我在 Ubuntu 14.04 中获得了安全更新,但在安装时它说你的磁盘已满。查看结果df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            980M  4.0K  980M   1% /dev
tmpfs           198M  1.2M  197M   1% /run
/dev/sda6        14G   11G  2.0G  85% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            990M   20M  971M   2% /run/shm
none            100M   44K  100M   1% /run/user
/dev/sda11       59G  8.4G   48G  16% /home

df -i

Filesystem      Inodes  IUsed   IFree IUse% Mounted on
udev            214806    544  214262    1% /dev
tmpfs           219956    568  219388    1% /run
/dev/sda6       915712 915645      67  100% /
none            219956      2  219954    1% /sys/fs/cgroup
none            219956      3  219953    1% /run/lock
none            219956     17  219939    1% /run/shm
none            219956     34  219922    1% /run/user
/dev/sda11     3907008 297045 3609963    8% /home

因此,我强制删除了一些较旧的 Ubuntu 内核,因为更新不允许我使用以下方法正常删除它:sudo dpkg --force-all -P linux-image-3.19.0-25-generic

但是,当我尝试运行命令时,为了完成更新,sudo apt-get install -f它会安装相同的旧内核并出现相同的内存错误:

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:
  libllvm3.6 libntdb1 linux-headers-3.19.0-25 linux-headers-3.19.0-25-generic
  linux-headers-4.4.0-34 linux-headers-4.4.0-34-generic
  linux-image-3.19.0-25-generic linux-image-4.4.0-34-generic
  linux-image-extra-3.19.0-25-generic linux-image-extra-4.4.0-34-generic
  python-ntdb tex-common
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-image-3.19.0-25-generic linux-image-3.19.0-61-generic
Suggested packages:
  fdutils linux-lts-vivid-tools
The following NEW packages will be installed:
  linux-image-3.19.0-25-generic linux-image-3.19.0-61-generic
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/32.1 MB of archives.
After this operation, 72.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 896123 files and directories currently installed.)
Preparing to unpack .../linux-image-3.19.0-25-generic_3.19.0-25.26~14.04.1_i386.deb ...
Done.
Unpacking linux-image-3.19.0-25-generic (3.19.0-25.26~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.19.0-25-generic_3.19.0-25.26~14.04.1_i386.deb (--unpack):
 unable to create '/lib/modules/3.19.0-25-generic/kernel/lib/raid6/raid6_pq.ko.dpkg-new' (while processing './lib/modules/3.19.0-25-generic/kernel/lib/raid6/raid6_pq.ko'): 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.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
Preparing to unpack .../linux-image-3.19.0-61-generic_3.19.0-61.69~14.04.1_i386.deb ...
Done.
Unpacking linux-image-3.19.0-61-generic (3.19.0-61.69~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.19.0-61-generic_3.19.0-61.69~14.04.1_i386.deb (--unpack):
 unable to create '/lib/modules/3.19.0-61-generic/kernel/net/ipv6/netfilter/ip6t_ipv6header.ko.dpkg-new' (while processing './lib/modules/3.19.0-61-generic/kernel/net/ipv6/netfilter/ip6t_ipv6header.ko'): 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.19.0-61-generic /boot/vmlinuz-3.19.0-61-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.19.0-61-generic /boot/vmlinuz-3.19.0-61-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.19.0-25-generic_3.19.0-25.26~14.04.1_i386.deb
 /var/cache/apt/archives/linux-image-3.19.0-61-generic_3.19.0-61.69~14.04.1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

如果我尝试安装任何随机软件,它也会出现以下情况:

sudo apt-get install python-distutils-extra 
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-image-extra-3.19.0-25-generic : Depends: linux-image-3.19.0-25-generic but it is not going to be installed
 linux-image-extra-3.19.0-61-generic : Depends: linux-image-3.19.0-61-generic but it is not going to be installed
 python-distutils-extra : Depends: intltool but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

有人能帮助我纠正这个问题吗?

答案1

运行此命令来添加任何构建依赖项:

sudo apt-get build-dep build-essential

来源:[man apt-get]

构建依赖:

build-dep 使 apt-get 安装/删除软件包,以尝试满足源软件包的构建依赖关系。默认情况下,依赖关系得到满足,以便本地构建软件包。如果需要,可以使用 --host-architecture 选项指定主机架构。

相关内容