apt-get upgrade 究竟如何工作?

apt-get upgrade 究竟如何工作?

我使用命令升级了我的 ubuntu 16.04 机器sudo apt-get upgrade。我知道它会安装所有需要更新的软件包。但我想知道具体过程。简而言之,我想阅读日志并消化一下,以便更熟悉 ubuntu。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libbonoboui2-0 libbonoboui2-common libgnomeui-0 libgnomeui-common libidl-2-0
  libkeybinder0 liborbit2 libvte-common libvte9 linux-headers-4.4.0-103
  linux-headers-4.4.0-103-generic linux-image-4.4.0-103-generic
  linux-image-extra-4.4.0-103-generic python-gconf python-gnome2
  python-gobject python-gobject-2 python-gtk2 python-keybinder python-notify
  python-pyorbit python-vte
0 upgraded, 0 newly installed, 22 to remove and 0 not upgraded.
After this operation, 308 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 389016 files and directories currently installed.)
Removing python-gnome2 (2.28.1+dfsg-1.1) ...
Removing libgnomeui-0:amd64 (2.24.5-3.1) ...
Removing libbonoboui2-0:amd64 (2.24.5-3ubuntu1) ...
Removing libbonoboui2-common (2.24.5-3ubuntu1) ...
Removing libgnomeui-common (2.24.5-3.1) ...
Removing python-pyorbit (2.24.0-7.1) ...
Removing liborbit2:amd64 (1:2.14.19-1build1) ...
Removing libidl-2-0:amd64 (0.8.14-4) ...
Removing python-keybinder (0.3.1-1) ...
Removing libkeybinder0 (0.3.1-1) ...
Removing python-vte (1:0.28.2-5ubuntu3) ...
Removing libvte9 (1:0.28.2-5ubuntu3) ...
Removing libvte-common (1:0.28.2-5ubuntu3) ...
Removing linux-headers-4.4.0-103-generic (4.4.0-103.126) ...
Removing linux-headers-4.4.0-103 (4.4.0-103.126) ...
Removing linux-image-extra-4.4.0-103-generic (4.4.0-103.126) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
Error! Your kernel headers for kernel 4.4.0-103-generic cannot be found.
Please install the linux-headers-4.4.0-103-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-103-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.10.0-42-generic
Found initrd image: /boot/initrd.img-4.10.0-42-generic
Found linux image: /boot/vmlinuz-4.10.0-40-generic
Found initrd image: /boot/initrd.img-4.10.0-40-generic
Found linux image: /boot/vmlinuz-4.10.0-35-generic
Found initrd image: /boot/initrd.img-4.10.0-35-generic
Found linux image: /boot/vmlinuz-4.4.0-104-generic
Found initrd image: /boot/initrd.img-4.4.0-104-generic
Found linux image: /boot/vmlinuz-4.4.0-103-generic
Found initrd image: /boot/initrd.img-4.4.0-103-generic
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-4.4.0-103-generic (4.4.0-103.126) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
dkms: removing: bcmwl 6.30.223.271+bdcom (4.4.0-103-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  bcmwl
Version: 6.30.223.271+bdcom
Kernel:  4.4.0-103-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-103-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-103-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-103-generic /boot/vmlinuz-4.4.0-103-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.10.0-42-generic
Found initrd image: /boot/initrd.img-4.10.0-42-generic
Found linux image: /boot/vmlinuz-4.10.0-40-generic
Found initrd image: /boot/initrd.img-4.10.0-40-generic
Found linux image: /boot/vmlinuz-4.10.0-35-generic
Found initrd image: /boot/initrd.img-4.10.0-35-generic
Found linux image: /boot/vmlinuz-4.4.0-104-generic
Found initrd image: /boot/initrd.img-4.4.0-104-generic
Adding boot menu entry for EFI firmware configuration
done
Removing python-gconf (2.28.1+dfsg-1.1) ...
Removing python-gobject (3.20.0-0ubuntu1) ...
Removing python-notify (0.1.1-4) ...
Removing python-gtk2 (2.24.0-4ubuntu1) ...
Removing python-gobject-2 (2.28.6-12ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...

答案1

尝试查看 APT 和 dpkg 日志:

  • /var/log/apt/history.log
  • /var/log/apt/term.log
  • /var/log/dpkg.log

您可以使用以下方式模拟升级过程

sudo apt-get upgrade --simulate

相关内容