无法更新 Ubuntu 16.04

无法更新 Ubuntu 16.04

我的软件中心已经堵塞了大约 2 周。当我单击安装更新时,进度条立即移动到一半...然后等待宇宙的尽头。

我该如何解决这个问题?我从未使用过 Ubuntu,只是假设我是临床上的阿米什人。

apt-get update编辑:这是运行并apt-get upgrade遵循 Azendale 的回答后的结果:

sudo apt-get update
[sudo] password for: 
Hit:1 htp://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 htp://archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Hit:3 htp://archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:4 htp://archive.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Get:5 htp://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [332 kB]
Get:6 htp://archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [328 kB]
Fetched 850 kB in 3s (275 kB/s)                          
Reading package lists... Done
:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-4.4.0-24-generic linux-image-4.4.0-28-generic
  linux-image-extra-4.4.0-24-generic linux-image-extra-4.4.0-28-generic
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic linux-signed-generic
  linux-signed-image-generic
The following packages will be upgraded:
  accountsservice apparmor bamfdaemon bind9-host chromium-codecs-ffmpeg-extra
  compiz compiz-core compiz-gnome compiz-plugins-default
  compizconfig-settings-manager cups-browsed cups-filters
  cups-filters-core-drivers dkms dnsutils eog file-roller firefox
  firefox-locale-en flashplugin-installer fontconfig fontconfig-config fwupd
  gir1.2-gdkpixbuf-2.0 gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0
  gnome-calendar gnome-font-viewer gnome-session-bin gnome-session-common
  gnome-settings-daemon-schemas gnome-sudoku gnome-system-monitor gnupg gpgv
  gtk2-engines-murrine ifupdown isc-dhcp-client isc-dhcp-common kpartx
  kpartx-boot libaccountsservice0 libapparmor-perl libapparmor1
  libappstream-glib8 libbamf3-2 libbind9-140 libcompizconfig0 libcupsfilters1
  libdecoration0 libdfu1 libdns-export162 libdns162 libdrm-amdgpu1
  libdrm-amdgpu1:i386 libdrm-dev libdrm-intel1 libdrm-intel1:i386
  libdrm-nouveau2 libdrm-nouveau2:i386 libdrm-radeon1 libdrm-radeon1:i386
  libdrm2 libdrm2:i386 libegl1-mesa libegl1-mesa-dev libfontconfig1
  libfontconfig1:i386 libfontembed1 libframe6 libfwupd1 libgbm1 libgcrypt20
  libgcrypt20:i386 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgl1-mesa-dev
  libgl1-mesa-dri libgl1-mesa-dri:i386 libgl1-mesa-glx libgl1-mesa-glx:i386
  libglapi-mesa libglapi-mesa:i386 libgles1-mesa libgles2-mesa
  libgles2-mesa-dev libgweather-3-6 libgweather-common libharfbuzz-icu0
  libharfbuzz0b libidn11 libidn11:i386 libisc-export160 libisc160 libisccc140
  libisccfg140 libjavascriptcoregtk-4.0-18 liblwres141 libmetacity-private3a
  libmysqlclient20:i386 libnm-glib-vpn1 libnm-glib4 libnm-gtk-common
  libnm-gtk0 libnm-util2 libnm0 libnma-common libnma0 libosmesa6
  libosmesa6:i386 liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0
  libp11-kit0 libp11-kit0:i386 libpam-systemd libpoppler-glib8 libpoppler58
  libpython3.5 libpython3.5-minimal libpython3.5-stdlib libsmbclient
  libssl1.0.0 libssl1.0.0:i386 libsystemd0 libsystemd0:i386 libudev-dev
  libudev1 libudev1:i386 libunity-core-6.0-9 libwayland-egl1-mesa libwbclient0
  libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-37-gtk2 libxatracker2 light-themes
  linux-libc-dev mesa-common-dev mesa-vdpau-drivers metacity metacity-common
  mtools mysql-common network-manager network-manager-gnome openssh-client
  openssl oxideqt-codecs-extra p11-kit p11-kit-modules p11-kit-modules:i386
  poppler-utils python-compizconfig python3-distupgrade
  python3-software-properties python3.5 python3.5-minimal samba-libs
  snap-confine snapd software-properties-common software-properties-gtk sudo
  suru-icon-theme systemd systemd-sysv thunderbird thunderbird-gnome-support
  thunderbird-locale-en thunderbird-locale-en-us ubuntu-artwork
  ubuntu-core-launcher ubuntu-drivers-common ubuntu-mobile-icons ubuntu-mono
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk ubuntu-session udev
  unity unity-schemas unity-services vino xdiagnose xserver-xorg-video-intel
185 upgraded, 0 newly installed, 4 to remove and 5 not upgraded.
13 not fully installed or removed.
Need to get 0 B/208 MB of archives.
After this operation, 410 MB disk space will be freed.
Do you want to continue? [Y/n] y
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 234231 files and directories currently installed.)
Removing linux-image-extra-4.4.0-24-generic (4.4.0-24.43) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-24-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
Error! Your kernel headers for kernel 4.4.0-24-generic cannot be found.
Please install the linux-headers-4.4.0-24-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-24-generic cannot be found.
Please install the linux-headers-4.4.0-24-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-24-generic cannot be found.
Please install the linux-headers-4.4.0-24-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-24-generic /boot/vmlinuz-4.4.0-24-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-24-generic
WARNING: missing /lib/modules/4.4.0-24-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-24-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_lU1drr/lib/modules/4.4.0-24-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_lU1drr/lib/modules/4.4.0-24-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
/usr/sbin/grub-mkconfig: 11: /etc/default/grub: quiet splash acpi_backlight=vendor acpi_osi='!Windows 2013' acpi_osi='!Windows 2012': not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-24-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-24-generic (4.4.0-24.43) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-24-generic /boot/vmlinuz-4.4.0-24-generic
/usr/sbin/grub-mkconfig: 11: /etc/default/grub: quiet splash acpi_backlight=vendor acpi_osi='!Windows 2013' acpi_osi='!Windows 2012': not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-24-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-24-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-28-generic (4.4.0-28.47) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-28-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
Error! Your kernel headers for kernel 4.4.0-28-generic cannot be found.
Please install the linux-headers-4.4.0-28-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-28-generic cannot be found.
Please install the linux-headers-4.4.0-28-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-28-generic cannot be found.
Please install the linux-headers-4.4.0-28-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-28-generic /boot/vmlinuz-4.4.0-28-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-28-generic
WARNING: missing /lib/modules/4.4.0-28-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-28-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_sMUWeu/lib/modules/4.4.0-28-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_sMUWeu/lib/modules/4.4.0-28-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
/usr/sbin/grub-mkconfig: 11: /etc/default/grub: quiet splash acpi_backlight=vendor acpi_osi='!Windows 2013' acpi_osi='!Windows 2012': not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-28-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-28-generic (4.4.0-28.47) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-28-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
/usr/sbin/grub-mkconfig: 11: /etc/default/grub: quiet splash acpi_backlight=vendor acpi_osi='!Windows 2013' acpi_osi='!Windows 2012': not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-28-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-28-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-image-extra-4.4.0-24-generic
 linux-image-4.4.0-24-generic
 linux-image-extra-4.4.0-28-generic
 linux-image-4.4.0-28-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

尝试打开终端并运行sudo apt update && sudo apt upgrade。它会提示您输入用户密码。现在您应该能够看到正在发生的任何错误。您可以使用它们来询问有关这些错误的更具体的问题。

答案2

您可能会看到这个错误(我在新安装后自己遇到了这个问题):https://bugs.launchpad.net/ubuntu/+source/appstream/+bug/1583845

您可以top在终端上使用该命令来查看这是否是您的问题。“appstreamcli”将显示使用 100% 的 CPU。

快速解决方法是删除 /usr/bin/appstreamcli 文件,然后更新到最新版本:

sudo rm /usr/bin/appstreamcli
sudo apt-get update
sudo apt-get install appstream

答案3

首先,打开仪表盘:

Ubuntu Dash 按钮

搜索 Ubuntu 软件中心:

Dash 搜索 Ubuntu 软件中心 软件中心启动屏幕

将鼠标光标移到屏幕顶部,选择“编辑”,然后选择“软件源”。

软件源菜单项

转到“其他软件”选项卡。尝试取消选中每个条目左侧的每个框。(别担心,您可以重复此过程,并在更新正常运行后一次打开几个更新,以找出哪些更新导致了您的问题并应保持关闭状态。因此,我们在这里所做的不一定是永久性的。) “其他软件”选项卡

单击关闭。系统可能会提示您更新软件包列表和/或输入密码。

身份验证对话框

之后,你应该看到(如果你点击

进度/任务选项卡

标签/图标)它们正在更新包列表:

进度/任务页面

如果成功完成,那么您现在就可以正常安装更新了!

编辑:您说您仍然收到有关签名问题的错误。打开 dash,搜索终端,然后打开它。

将其放入:

sudo apt-get update
sudo apt-get upgrade

然后复制输出,编辑原始问题,并在末尾添加终端的输出。我们将从那里开始。不需要重新安装。

编辑:好的,看起来内核包有些奇怪。你可以从终端获取输出并将其作为一个新问题,标题类似于“Apt update trouble with linux-headers-4.4.0-24-generic”,这样更有可能有比我更了解的人来回答你的问题。但我也会试着猜测我们下一步应该尝试什么。

您可以尝试在终端中运行它吗(然后再次编辑您的问题以将输出添加到末尾):

sudo apt-get install linux-headers-4.4.0-24-generic
sudo apt-get install -f

我不确定你必须按照什么顺序来做这些事情,但做多次也不会有什么坏处,所以如果需要的话,你可以按照两个顺序尝试这些命令。

相关内容