![从失败的升级中恢复(14.04 -> 16.04,但可能适用于所有版本)](https://linux22.com/image/1205360/%E4%BB%8E%E5%A4%B1%E8%B4%A5%E7%9A%84%E5%8D%87%E7%BA%A7%E4%B8%AD%E6%81%A2%E5%A4%8D%EF%BC%8814.04%20-%3E%2016.04%EF%BC%8C%E4%BD%86%E5%8F%AF%E8%83%BD%E9%80%82%E7%94%A8%E4%BA%8E%E6%89%80%E6%9C%89%E7%89%88%E6%9C%AC%EF%BC%89.png)
我正在将 Ubuntu 系统从 14.04LTS 升级到 16.04LTS。(这是一个服务器系统,只能通过命令行访问)
无论如何,我尝试进行升级:
sudo do-release-upgrade
...
但失败了:
请将此报告为错误,并在报告中包括文件 /var/log/dist-upgrade/main.log 和 /var/log/dist-upgrade/apt.log。升级已中止。您的原始 sources.list 已保存在 /etc/apt/sources.list.distUpgrade 中。
SystemError:E:子进程 /usr/bin/dpkg 返回错误代码 (1)
我重启了系统,仍然可以访问它。但是,我的系统只是部分升级。我正在尝试弄清楚如何“完成”升级:
它认为我在使用 16.04:
lsb_release -a
LSB Version: core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0 noarch:core-3.1-ia32:core-3.1-noarchh
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
尝试手动更新失败:
sudo apt-get update && sudo apt-get upgrade
Hit:1 http://mirrors.linode.com/ubuntu xenial InRelease
Hit:2 http://mirrors.linode.com/ubuntu xenial-updates InRelease
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Fetched 107 kB in 10s (10.1 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
parted
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
dist-upgrade 给出了相同的结果:
sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
parted
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
当我手动尝试升级“parted”时,出现以下错误:
sudo apt-get --with-new-pkgs upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libparted1.6-0 : Conflicts: libparted2 but 3.2-15ubuntu0.1 is to be installed
Recommends: libreiserfs0.3-0 but it is not installable
libparted1.6-12 : Conflicts: libparted2 but 3.2-15ubuntu0.1 is to be installed
libparted1.6-13 : Conflicts: libparted2 but 3.2-15ubuntu0.1 is to be installed
E: Broken packages
我(愚蠢地)认为我应该从 16.04 升级到 18.04,但是当我现在运行命令时,系统识别到软件包并未全部升级:
sudo do-release-upgrade
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.
那么,如何让安装继续完成?我尝试了各种命令,但均未成功:
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update --fix-missing
sudo apt-get install --fix-broken
答案1
我不完全确定我到底做了什么,但似乎这个命令让我再次开始行动:
sudo apt-get --reinstall dselect-upgrade