错误信息如下:
root@f49:/home/ws# apt-get install nethogs
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 unmetdependencies:
linux-image-extra-4.4.0-51-generic : Depends:linux-image-4.4.0-51-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-51-genericbut it is not going to be installed
Recommends: thermald butit is not going to be installed
E: Unmet dependencies. Try 'apt-get -finstall' with no packages (or specify a solution).
root@f49:/home/ws# apt-get -f installnethogs
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 unmetdependencies:
linux-image-extra-4.4.0-51-generic : Depends:linux-image-4.4.0-51-generic but it is not going to be installed
linux-image-generic : Depends:linux-image-4.4.0-51-generic but it is not going to be installed
Recommends: thermald butit is not going to be installed
E: Unmet dependencies. Try 'apt-get -finstall' with no packages (or specify a solution).
root@f49:/home/ws# uname -a
Linux f49 4.4.0-47-generic #68-Ubuntu SMPWed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
=======================================================
root@f49:~# sudo apt-get installlinux-image-4.4.0-51-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automaticallyinstalled and are no longer required:
linux-headers-4.4.0-21 linux-headers-4.4.0-21-genericlinux-headers-4.4.0-22
linux-headers-4.4.0-22-generic linux-headers-4.4.0-24linux-headers-4.4.0-24-generic
linux-headers-4.4.0-28 linux-headers-4.4.0-28-genericlinux-headers-4.4.0-31
linux-headers-4.4.0-31-generic linux-headers-4.4.0-36linux-headers-4.4.0-36-generic
linux-headers-4.4.0-38 linux-headers-4.4.0-38-genericlinux-headers-4.4.0-42
linux-headers-4.4.0-42-generic linux-image-4.4.0-21-generic
linux-image-4.4.0-22-generic linux-image-4.4.0-24-generic
linux-image-4.4.0-28-generic linux-image-4.4.0-31-generic
linux-image-4.4.0-36-generic linux-image-4.4.0-38-generic
linux-image-4.4.0-42-generic linux-image-extra-4.4.0-21-generic
linux-image-extra-4.4.0-22-generic linux-image-extra-4.4.0-24-generic
linux-image-extra-4.4.0-28-generic linux-image-extra-4.4.0-31-generic
linux-image-extra-4.4.0-36-generic linux-image-extra-4.4.0-38-generic
linux-image-extra-4.4.0-42-generic
Use 'sudo apt autoremove'to remove them.
Suggested packages:
fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will beinstalled:
linux-image-4.4.0-51-generic
0 upgraded, 1 newly installed, 0 to removeand 152 not upgraded.
4 not fully installed or removed.
Need to get 0 B/19.2 MB of archives.
After this operation, 57.1 MB of additionaldisk space will be used.
(Reading database ... 392100 files anddirectories currently installed.)
Preparing to unpack.../linux-image-4.4.0-51-generic_4.4.0-51.72_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-51-generic(4.4.0-51.72) ...
dpkg: error processingarchive/var/cache/apt/archives/linux-image-4.4.0-51-generic_4.4.0-51.72_amd64.deb(--unpack):
cannot copy extracted data for'./boot/vmlinuz-4.4.0-51-generic' to '/boot/vmlinuz-4.4.0-51-generic.dpkg-new':failed to write (No space left on device)
No apport report written because the errormessage 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 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
run-parts: executing/etc/kernel/postrm.d/zz-update-grub 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-4.4.0-51-generic_4.4.0-51.72_amd64.deb
E: Sub-process /usr/bin/dpkg returned anerror code (1)
root@f49:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 387M 11M 376M 3% /run
/dev/mapper/f49--vg-root 88G 8.0G 76G 10% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sdb1 472M 471M 0 100% /boot
tmpfs 100K 0 100K 0% /run/lxcfs/controllers
tmpfs 387M 0 387M 0% /run/user/0
=====================================================================
root@f49:/boot# apt-get purgelinux-image-4.4.0-21-generic //清除老版本,腾出/boot空间
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 unmetdependencies:
linux-image-extra-4.4.0-21-generic : Depends:linux-image-4.4.0-21-generic but it is not going to be installed
linux-image-extra-4.4.0-51-generic : Depends:linux-image-4.4.0-51-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-51-genericbut it is not going to be installed
Recommends: thermald butit is not going to be installed
E: Unmet dependencies. Try 'apt-get -finstall' with no packages (or specify a solution).
//出错,如何扩展/boot,同时不会影响已有的安装????
建议如下:
1、If youneed more space individually remove old vmlinuz initrd, abi and System.mapfiles until you have enough space (about 22 megs for one of my i386 kernelversions).
2、Whateveryou do, don't remove them all. You should at least keep the latesttwo matching versions of each kind of file, for each kind of kernel you use.
3、Whenyou have apt working again, clean up by using apt-get to remove the packagescorresponding to the files you removed--so everything matches.
4、Do not use sudo rm toremove from /boot. Instead, use sudo dpkg --purge to remove some oldlinux-image package. Thereafter use sudo apt-get -f install to fixthe broken dependency.
在/boot目录下删除掉版本,以便腾出足够的空间装进新版本,使用rm命令删除直到剩下最新的3个版本root@f49:/boot# rm *-4.4.0-21-generic
root@f49:/boot# ls
abi-4.4.0-22-generic config-4.4.0-45-generic System.map-4.4.0-31-generic
abi-4.4.0-24-generic config-4.4.0-47-generic System.map-4.4.0-36-generic
abi-4.4.0-28-generic grub System.map-4.4.0-38-generic
abi-4.4.0-31-generic initrd.img-4.4.0-22-generic System.map-4.4.0-42-generic
abi-4.4.0-36-generic initrd.img-4.4.0-24-generic System.map-4.4.0-45-generic
abi-4.4.0-38-generic initrd.img-4.4.0-28-generic System.map-4.4.0-47-generic
abi-4.4.0-42-generic initrd.img-4.4.0-31-generic vmlinuz-4.4.0-22-generic
abi-4.4.0-45-generic initrd.img-4.4.0-36-generic vmlinuz-4.4.0-24-generic
abi-4.4.0-47-generic initrd.img-4.4.0-38-generic vmlinuz-4.4.0-28-generic
config-4.4.0-22-generic initrd.img-4.4.0-42-generic vmlinuz-4.4.0-31-generic
config-4.4.0-24-generic initrd.img-4.4.0-45-generic vmlinuz-4.4.0-36-generic
config-4.4.0-28-generic initrd.img-4.4.0-47-generic vmlinuz-4.4.0-38-generic
config-4.4.0-31-generic lost+found vmlinuz-4.4.0-42-generic
config-4.4.0-36-generic System.map-4.4.0-22-generic vmlinuz-4.4.0-45-generic
config-4.4.0-38-generic System.map-4.4.0-24-generic vmlinuz-4.4.0-47-generic
config-4.4.0-42-generic System.map-4.4.0-28-generic
root@f49:/boot# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 387M 11M 376M 3% /run
/dev/mapper/f49--vg-root 88G 7.7G 76G 10% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sdb1 472M 425M 23M 95% /boot
tmpfs 100K 0 100K 0% /run/lxcfs/controllers
tmpfs 387M 0 387M 0% /run/user/0
........
root@f49:/boot# ls
abi-4.4.0-42-generic grub System.map-4.4.0-45-generic
abi-4.4.0-45-generic initrd.img-4.4.0-42-generic System.map-4.4.0-47-generic
abi-4.4.0-47-generic initrd.img-4.4.0-45-generic vmlinuz-4.4.0-42-generic
config-4.4.0-42-generic initrd.img-4.4.0-47-generic vmlinuz-4.4.0-45-generic
config-4.4.0-45-generic lost+found vmlinuz-4.4.0-47-generic
config-4.4.0-47-generic System.map-4.4.0-42-generic
root@f49:/boot# df -h | grep /boot
/dev/sdb1 472M 149M 299M 34% /boot
====================================================================
感觉上面的步骤已经给/boot腾出充足的空间
root@f49:/boot# sudo apt-get installlinux-image-4.4.0-51-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automaticallyinstalled and are no longer required:
linux-headers-4.4.0-21 linux-headers-4.4.0-21-genericlinux-headers-4.4.0-22
linux-headers-4.4.0-22-generic linux-headers-4.4.0-24linux-headers-4.4.0-24-generic
linux-headers-4.4.0-28 linux-headers-4.4.0-28-genericlinux-headers-4.4.0-31
linux-headers-4.4.0-31-generic linux-headers-4.4.0-36linux-headers-4.4.0-36-generic
linux-headers-4.4.0-38 linux-headers-4.4.0-38-genericlinux-headers-4.4.0-42
linux-headers-4.4.0-42-generic linux-image-4.4.0-21-generic
linux-image-4.4.0-22-generic linux-image-4.4.0-24-generic
linux-image-4.4.0-28-generic linux-image-4.4.0-31-generic
linux-image-4.4.0-36-generic linux-image-4.4.0-38-generic
linux-image-4.4.0-42-generic linux-image-extra-4.4.0-21-generic
linux-image-extra-4.4.0-22-generic linux-image-extra-4.4.0-24-generic
linux-image-extra-4.4.0-28-generic linux-image-extra-4.4.0-31-generic
linux-image-extra-4.4.0-36-generic linux-image-extra-4.4.0-38-generic
linux-image-extra-4.4.0-42-generic
Use 'sudo aptautoremove' to remove them.
Suggested packages:
fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will beinstalled:
linux-image-4.4.0-51-generic
0 upgraded, 1 newly installed, 0 to removeand 152 not upgraded.
4 not fully installed or removed.
Need to get 19.2 MB of archives.
After this operation, 57.1 MB of additionaldisk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntuxenial-updates/main amd64 linux-image-4.4.0-51-generic amd64 4.4.0-51.72 [19.2MB]
Fetched 19.2 MB in 22s (854 kB/s)
(Reading database ... 392100 files anddirectories currently installed.)
Preparing to unpack.../linux-image-4.4.0-51-generic_4.4.0-51.72_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-51-generic(4.4.0-51.72) ...
Setting up linux-image-4.4.0-51-generic(4.4.0-51.72) ...
Running depmod.
update-initramfs: deferring update (hookwill be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing/etc/kernel/postinst.d/initramfs-tools 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating/boot/initrd.img-4.4.0-51-generic
W: plymouth: The plugin label.so ismissing, the selected theme might not work as expected.
W: plymouth: You might want to install theplymouth-themes and plymouth-label package to fix this.
W: mdadm: /etc/mdadm/mdadm.conf defines noarrays.
run-parts: executing/etc/kernel/postinst.d/unattended-upgrades 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
run-parts: executing/etc/kernel/postinst.d/update-notifier 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
run-parts: executing/etc/kernel/postinst.d/zz-update-grub 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
Generating grub configuration file ...
Found linux image:/boot/vmlinuz-4.4.0-51-generic
Found initrd image:/boot/initrd.img-4.4.0-51-generic
Found linux image:/boot/vmlinuz-4.4.0-47-generic
Found initrd image:/boot/initrd.img-4.4.0-47-generic
Found linux image:/boot/vmlinuz-4.4.0-45-generic
Found initrd image:/boot/initrd.img-4.4.0-45-generic
Found linux image:/boot/vmlinuz-4.4.0-42-generic
Found initrd image:/boot/initrd.img-4.4.0-42-generic
done
Setting uplinux-image-extra-4.4.0-51-generic (4.4.0-51.72) ...
run-parts: executing/etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
run-parts: executing/etc/kernel/postinst.d/initramfs-tools 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating/boot/initrd.img-4.4.0-51-generic
W: plymouth: The plugin label.so ismissing, the selected theme might not work as expected.
W: plymouth: You might want to install theplymouth-themes and plymouth-label package to fix this.
W: mdadm: /etc/mdadm/mdadm.conf defines noarrays.
run-parts: executing/etc/kernel/postinst.d/unattended-upgrades 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
run-parts: executing/etc/kernel/postinst.d/update-notifier 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
run-parts: executing/etc/kernel/postinst.d/zz-update-grub 4.4.0-51-generic/boot/vmlinuz-4.4.0-51-generic
Generating grub configuration file ...
Found linux image:/boot/vmlinuz-4.4.0-51-generic
Found initrd image:/boot/initrd.img-4.4.0-51-generic
Found linux image:/boot/vmlinuz-4.4.0-47-generic
Found initrd image:/boot/initrd.img-4.4.0-47-generic
Found linux image:/boot/vmlinuz-4.4.0-45-generic
Found initrd image:/boot/initrd.img-4.4.0-45-generic
Found linux image:/boot/vmlinuz-4.4.0-42-generic
Found initrd image:/boot/initrd.img-4.4.0-42-generic
done
Setting up linux-image-generic(4.4.0.51.54) ...
Setting up linux-generic (4.4.0.51.54) ...
Setting uplinux-image-extra-4.4.0-47-generic (4.4.0-47.68) ...
run-parts: executing/etc/kernel/postinst.d/apt-auto-removal 4.4.0-47-generic/boot/vmlinuz-4.4.0-47-generic
run-parts: executing/etc/kernel/postinst.d/initramfs-tools 4.4.0-47-generic/boot/vmlinuz-4.4.0-47-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-47-generic
W: plymouth: The plugin label.so ismissing, the selected theme might not work as expected.
W: plymouth: You might want to install theplymouth-themes and plymouth-label package to fix this.
W: mdadm: /etc/mdadm/mdadm.conf defines noarrays.
run-parts: executing/etc/kernel/postinst.d/unattended-upgrades 4.4.0-47-generic/boot/vmlinuz-4.4.0-47-generic
run-parts: executing/etc/kernel/postinst.d/update-notifier 4.4.0-47-generic/boot/vmlinuz-4.4.0-47-generic
run-parts: executing/etc/kernel/postinst.d/zz-update-grub 4.4.0-47-generic/boot/vmlinuz-4.4.0-47-generic
Generating grub configuration file ...
Found linux image:/boot/vmlinuz-4.4.0-51-generic
Found initrd image:/boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image:/boot/initrd.img-4.4.0-47-generic
Found linux image:/boot/vmlinuz-4.4.0-45-generic
Found initrd image:/boot/initrd.img-4.4.0-45-generic
Found linux image:/boot/vmlinuz-4.4.0-42-generic
Found initrd image: /boot/initrd.img-4.4.0-42-generic
done
root@f49:/boot# ls -al *-4.4.0-51-generic //说明成功安装
-rw-r--r-- 1 root root 1243479 Nov 24 16:12 abi-4.4.0-51-generic
-rw-r--r-- 1 root root 189877 Nov 24 16:12 config-4.4.0-51-generic
-rw-r--r-- 1 root root 36188057 Jan 8 21:47 initrd.img-4.4.0-51-generic
-rw------- 1 root root 3874377 Nov 24 16:12System.map-4.4.0-51-generic
-rw------- 1 root root 7064208 Nov 24 16:12 vmlinuz-4.4.0-51-generic
======================================================================
root@f49:/boot# apt-get autoremove //清除旧版本的残余
省略掉执行过程........
root@f49:/boot# ls
abi-4.4.0-47-generic grub System.map-4.4.0-47-generic
abi-4.4.0-51-generic initrd.img-4.4.0-47-generic System.map-4.4.0-51-generic
config-4.4.0-47-generic initrd.img-4.4.0-51-generic vmlinuz-4.4.0-47-generic
config-4.4.0-51-generic lost+found vmlinuz-4.4.0-51-generic
root@f49:/boot#
root@f49:/boot# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 387M 11M 376M 3% /run
/dev/mapper/f49--vg-root 88G 4.9G 79G 6% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sdb1 472M 102M 346M 23% /boot
tmpfs 100K 0 100K 0% /run/lxcfs/controllers
tmpfs 387M 0 387M 0% /run/user/0
//由此可见,只保留最新的两个版本对应的abi/config/initrd/System-map/vmlinuz;
系统版本精简之后,/boot的空间更大,问题
==================================================================
root@f49:/boot# apt-get install nethogs //成功安装nethogs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will beinstalled:
nethogs
0 upgraded, 1 newly installed, 0 to removeand 152 not upgraded.
Need to get 25.9 kB of archives.
After this operation, 72.7 kB of additionaldisk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntuxenial/universe amd64 nethogs amd64 0.8.1-0.3 [25.9 kB]
Fetched 25.9 kB in 0s (28.8 kB/s)
Selecting previously unselected packagenethogs.
(Reading database ... 103056 files anddirectories currently installed.)
Preparing to unpack.../nethogs_0.8.1-0.3_amd64.deb ...
Unpacking nethogs (0.8.1-0.3) ...
Processing triggers for man-db (2.7.5-1)...
Setting up nethogs (0.8.1-0.3) ...
======================================================================