从 14.04 升级到 16.04.1 时出现问题

从 14.04 升级到 16.04.1 时出现问题

我想升级我的系统。所以我做了:

sudo do-release-upgrade

但我有一个重大错误:

Upgrading Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-qgoff5d4/xenial", line 8, in 
  File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeMain.py", line 242, in main
  File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeController.py", line 1876, in run
  File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeController.py", line 1841, in fullUpgrade
  File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeController.py", line 1257, in doDistUpgrade
UnboundLocalError: local variable 'e' referenced before assignment
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 109, in apport_excepthook
    pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME'])
  File "/usr/lib/python3/dist-packages/apport/report.py", line 532, in add_proc_info
    self['ExecutableTimestamp'] = str(int(os.stat(self['ExecutablePath']).st_mtime))
PermissionError: [Errno 13] Permission denied: '/tmp/ubuntu-release-upgrader-qgoff5d4/xenial'

Original exception was: Traceback (most recent call last): File "/tmp/ubuntu-release-upgrader-qgoff5d4/xenial", line 8, in File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeMain.py", line 242, in main File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeController.py", line 1876, in run File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeController.py", line 1841, in fullUpgrade File "/tmp/ubuntu-release-upgrader-qgoff5d4/DistUpgrade/DistUpgradeController.py", line 1257, in doDistUpgrade UnboundLocalError: local variable 'e' referenced before assignment

我到处找,但找不到解决方案。如果有人能帮忙,我将不胜感激。

答案1

你可以试试sudo apt 安装-f但除此之外,最好进行全新安装。在已安装并激活专有显卡驱动程序的情况下,在线升级可能不起作用。

答案2

尝试这个:

第一:您需要更新系统。

打开终端,

Ctrl++AltT

运行:

exec sudo -i
apt-get update
apt-get dist-upgrade
apt-get autoremove
apt-get clean

重新启动系统以完成安装更新,并将 upstart 更改为 systemd:

打开终端,

Ctrl++AltT

运行:

exec sudo -i
add-apt-repository ppa:pitti/systemd
apt-get update
apt-get install systemd libpam-systemd systemd-ui
apt-get dist-upgrade
cp /etc/default/grub /etc/default/grub.bak
nano /etc/default/grub 

在打开的文件中保留此行:

GRUB_CMDLINE_LINUX_DEFAULT = "init=/lib/systemd/systemd" 

继续运行:

update-grub
ln -fs /proc/self/mounts /etc/mtab

重新启动系统,

如果出现任何问题,可以运行以下命令撤消更改:

exec sudo -i
mv /etc/default/grub.bak /etc/default/grub
update-grub

如果一切顺利,并升级到新的可用版本:

打开终端,

Ctrl++AltT

运行:

exec sudo -i
update-manager -d

软件更新程序将出现并搜索新版本,几秒钟后,您将看到如下所示的屏幕:

不过,Ubuntu 16.04 现在已经可用。

按下升级按钮开始升级到 Ubuntu 16.04。

软件更新程序将要求您确认是否仍要升级,按“开始升级”即可开始安装 Ubuntu 16.04。

现在,软件更新程序将准备开始设置新的软件频道,几分钟后,软件更新程序将通知您将要删除的软件包数量以及将要安装的软件包数量的详细信息,按开始升级继续。

结束 dist-upgrade,重新启动系统并:

打开终端,

Ctrl++AltT

运行:

exec sudo -i
dpkg --configure -a
apt-get -f install
apt-get update
apt-get dist-upgrade
apt-get autoremove
apt-get clean

相关内容