在 Azure 上的虚拟机上将 Ubuntu 18.04 升级到 20.04 失败

在 Azure 上的虚拟机上将 Ubuntu 18.04 升级到 20.04 失败

出于安全原因,我正尝试将 Azure 上的虚拟机上的 Ubuntu 18 升级到 20 - 支持终止。

最简单的方法失败了:$ sudo do-release-upgrade不幸的是,我对此没有终端响应。

现在我正在尝试: $ sudo apt update

回应:

Hit:1 http://azure.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Get:5 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2917 kB]
Get:6 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [2419 kB]
Fetched 5558 kB in 2s (2538 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

$ sudo apt upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-tools-5.4.0-1059-azure : Depends: linux-azure-tools-5.4.0-1059 but it is not installed
 linux-tools-5.4.0-1100-azure : Depends: linux-azure-tools-5.4.0-1100 but it is not installed
 linux-tools-5.4.0-1109-azure : Depends: linux-azure-tools-5.4.0-1109 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

$ sudo apt --fix-broken 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:
  acpid btrfs-tools command-not-found-data dns-root-data dnsmasq-base ebtables gcc-8-base geoip-database libargon2-0 libbind9-160 libdns-export1100
  libdns1100 libevent-2.1-6 libffi6 libgdbm5 libgeoip1 libhogweed4 libicu60 libidn11 libip4tc0 libip6tc0 libiptc0 libirs160 libisc-export169 libisc169
  libisccc160 libisccfg160 libjson-c3 liblvm2app2.2 liblvm2cmd2.02 liblwres160 liblxc-common liblxc1 libncurses5 libncursesw5 libnettle6
  libnginx-mod-http-geoip libntfs-3g88 libperl5.26 libplymouth4 libpython3.6 libpython3.6-minimal libpython3.6-stdlib libreadline7 libssl1.0.0 libtinfo5
  linux-azure-5.4-cloud-tools-5.4.0-1061 linux-azure-5.4-cloud-tools-5.4.0-1062 linux-azure-5.4-cloud-tools-5.4.0-1063
  linux-azure-5.4-cloud-tools-5.4.0-1064 linux-azure-5.4-cloud-tools-5.4.0-1065 linux-azure-5.4-cloud-tools-5.4.0-1067
  linux-azure-5.4-cloud-tools-5.4.0-1068 linux-azure-5.4-cloud-tools-5.4.0-1069 linux-azure-5.4-cloud-tools-5.4.0-1070
  linux-azure-5.4-cloud-tools-5.4.0-1072 linux-azure-5.4-cloud-tools-5.4.0-1073 linux-azure-5.4-cloud-tools-5.4.0-1074
  linux-azure-5.4-cloud-tools-5.4.0-1077 linux-azure-5.4-cloud-tools-5.4.0-1078 linux-azure-5.4-cloud-tools-5.4.0-1080
  linux-azure-5.4-cloud-tools-5.4.0-1083 linux-azure-5.4-cloud-tools-5.4.0-1085 linux-azure-5.4-cloud-tools-5.4.0-1086
  linux-azure-5.4-cloud-tools-5.4.0-1089 linux-azure-5.4-cloud-tools-5.4.0-1094 linux-azure-5.4-cloud-tools-5.4.0-1095
  linux-azure-5.4-cloud-tools-5.4.0-1098 linux-azure-5.4-cloud-tools-5.4.0-1100 linux-azure-5.4-cloud-tools-5.4.0-1109 linux-azure-5.4-headers-5.4.0-1061
  linux-azure-5.4-headers-5.4.0-1062 linux-azure-5.4-headers-5.4.0-1063 linux-azure-5.4-headers-5.4.0-1064 linux-azure-5.4-headers-5.4.0-1065
  linux-azure-5.4-headers-5.4.0-1067 linux-azure-5.4-headers-5.4.0-1068 linux-azure-5.4-headers-5.4.0-1069 linux-azure-5.4-headers-5.4.0-1070
  linux-azure-5.4-headers-5.4.0-1072 linux-azure-5.4-headers-5.4.0-1073 linux-azure-5.4-headers-5.4.0-1074 linux-azure-5.4-headers-5.4.0-1077
  linux-azure-5.4-headers-5.4.0-1078 linux-azure-5.4-headers-5.4.0-1080 linux-azure-5.4-headers-5.4.0-1083 linux-azure-5.4-headers-5.4.0-1085
  linux-azure-5.4-headers-5.4.0-1086 linux-azure-5.4-headers-5.4.0-1089 linux-azure-5.4-headers-5.4.0-1094 linux-azure-5.4-headers-5.4.0-1095
  linux-azure-5.4-headers-5.4.0-1098 linux-azure-5.4-headers-5.4.0-1100 linux-azure-5.4-headers-5.4.0-1109 linux-azure-5.4-tools-5.4.0-1061
  linux-azure-5.4-tools-5.4.0-1062 linux-azure-5.4-tools-5.4.0-1063 linux-azure-5.4-tools-5.4.0-1064 linux-azure-5.4-tools-5.4.0-1065
  linux-azure-5.4-tools-5.4.0-1067 linux-azure-5.4-tools-5.4.0-1068 linux-azure-5.4-tools-5.4.0-1069 linux-azure-5.4-tools-5.4.0-1070
  linux-azure-5.4-tools-5.4.0-1072 linux-azure-5.4-tools-5.4.0-1073 linux-azure-5.4-tools-5.4.0-1074 linux-azure-5.4-tools-5.4.0-1077
  linux-azure-5.4-tools-5.4.0-1078 linux-azure-5.4-tools-5.4.0-1080 linux-azure-5.4-tools-5.4.0-1083 linux-azure-5.4-tools-5.4.0-1085
  linux-azure-5.4-tools-5.4.0-1086 linux-azure-5.4-tools-5.4.0-1089 linux-azure-5.4-tools-5.4.0-1094 linux-azure-5.4-tools-5.4.0-1095
  linux-azure-5.4-tools-5.4.0-1098 linux-azure-5.4-tools-5.4.0-1100 linux-azure-5.4-tools-5.4.0-1109 linux-azure-cloud-tools-5.4.0-1100
  linux-azure-headers-5.4.0-1100 linux-azure-tools-5.4.0-1100 linux-cloud-tools-5.4.0-1100-azure linux-headers-5.4.0-1100-azure
  linux-image-5.4.0-1100-azure linux-modules-5.4.0-1100-azure linux-modules-extra-5.4.0-1100-azure linux-tools-5.4.0-1100-azure lxcfs lxd lxd-client
  multiarch-support net-tools nplan python3-asn1crypto python3-pam python3.6 python3.6-minimal uidmap xdelta3
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-azure-tools-5.4.0-1059 linux-azure-tools-5.4.0-1100 linux-azure-tools-5.4.0-1109
The following NEW packages will be installed:
  linux-azure-tools-5.4.0-1059 linux-azure-tools-5.4.0-1100 linux-azure-tools-5.4.0-1109
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
3 not fully installed or removed.
Need to get 0 B/15.8 MB of archives.
After this operation, 74.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
E: Sub-process /usr/bin/dpkg exited unexpectedly

这是我的最后一个想法:) $ sudo dpkg --configure -a

dpkg: dependency problems prevent configuration of linux-tools-5.4.0-1059-azure:
 linux-tools-5.4.0-1059-azure depends on linux-azure-tools-5.4.0-1059; however:
  Package linux-azure-tools-5.4.0-1059 is not installed.

dpkg: error processing package linux-tools-5.4.0-1059-azure (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-tools-5.4.0-1109-azure:
 linux-tools-5.4.0-1109-azure depends on linux-azure-tools-5.4.0-1109; however:
  Package linux-azure-tools-5.4.0-1109 is not installed.

dpkg: error processing package linux-tools-5.4.0-1109-azure (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-tools-5.4.0-1100-azure:
 linux-tools-5.4.0-1100-azure depends on linux-azure-tools-5.4.0-1100; however:
  Package linux-azure-tools-5.4.0-1100 is not installed.

dpkg: error processing package linux-tools-5.4.0-1100-azure (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-tools-5.4.0-1059-azure
 linux-tools-5.4.0-1109-azure
 linux-tools-5.4.0-1100-azure

任何帮助将不胜感激。

根据@OrganicMarble建议进行更新:

$ sudo apt autoremove

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-tools-5.4.0-1059-azure : Depends: linux-azure-tools-5.4.0-1059 but it is not installed
 linux-tools-5.4.0-1100-azure : Depends: linux-azure-tools-5.4.0-1100 but it is not installed
 linux-tools-5.4.0-1109-azure : Depends: linux-azure-tools-5.4.0-1109 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

答案1

请尝试以下操作:

sudo dpkg --remove --force-depends linux-azure-tools-5.4.0-1059
sudo dpkg --remove --force-depends linux-azure-tools-5.4.0-1100
sudo dpkg --remove --force-depends linux-azure-tools-5.4.0-1109
sudo dpkg --remove --force-depends linux-tools-azure

sudo apt --fix-broken install
sudo apt update && sudo apt install linux-tools-azure
apt upgrade -y
sudo apt autoremove

答案2

你只需要像这样删除

sudo apt remove linux-tools-5.4.0-1109-azure

相关内容