首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Ubuntu 18.04.5升级到20.04失败

Ubuntu 18.04.5升级到20.04失败
EN

Ask Ubuntu用户
提问于 2021-08-12 11:15:32
回答 1查看 2.2K关注 0票数 2

我的服务器让我抓狂,我试图将当前的hdd更改为一个新的ssd,然后设置Raid和一个有效的备份系统。但那是另外一个问题..。

我已经将当前系统的副本复制到了SSD,所以我想,这是一个备份,让我尝试输入最新的LTS,所以快速命令是:

代码语言:javascript
运行
复制
sudo do-release-upgrade

消息失败:

代码语言:javascript
运行
复制
Checking for a new Ubuntu release  
Please install all available updates for your release before upgrading.

所以我不得不:

代码语言:javascript
运行
复制
sudo apt-get update
sudo apt-get upgrade

当它第一次安装了一堆东西并且停止了,或者我不得不重新启动的时候,不记得在过去做的很好。现在,当我运行升级时,我有了这个错误:

代码语言:javascript
运行
复制
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.  
 lxd : Depends: lxd-client (= 3.0.3-0ubuntu1~18.04.1) but 1:0.9 is installed  
 lxd-client : Depends: lxd (>= 1:0.9) but 3.0.3-0ubuntu1~18.04.1 is installed  
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

所以我照消息说的做了:

代码语言:javascript
运行
复制
sudo apt --fix-broken install

和新的错误:

代码语言:javascript
运行
复制
Setting up udev (245.4-4ubuntu3.10) ...  
Failed to restart udev.service: Unit systemd-udevd.service is not loaded properly: Exec format error.  
See system logs and 'systemctl status udev.service' for details.  
invoke-rc.d: initscript udev, action "restart" failed.  
 systemd-udevd.service - udev Kernel Device Manager  
   Loaded: error (Reason: Exec format error)  
   Active: inactive (dead)  
     Docs: man:systemd-udevd.service(8)  
           man:udev(7)  
Aug 12 11:36:10 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 11:39:00 AtomServer systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.  
Aug 12 11:41:35 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 11:41:35 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 11:41:35 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 11:41:35 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:00:56 AtomServer systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.  
Aug 12 12:00:59 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:00:59 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:01:00 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
dpkg: error processing package udev (--configure):  
 installed udev package post-installation script subprocess returned error exit status 1  
dpkg: dependency problems prevent configuration of snapd:  
 snapd depends on udev; however:  
  Package udev is not configured yet.  
dpkg: error processing package snapd (--configure):  
 dependency problems - leaving unconfigured  
No apport report written because the error message indicates it's a follow-up error from a previous failure.                                                                                                      Errors were encountered while processing:  
 udev  
 snapd  
E: Sub-process /usr/bin/dpkg returned an error code (1)

此时,我什么也做不了,读了几篇帖子和类似的问题,发出了一些命令,比如:

代码语言:javascript
运行
复制
dpkg --configure -a 
sudo dpkg --force-all -i /var/cache/apt/archives/udev_245.4-4ubuntu3.10_amd64.deb

同样的问题:

代码语言:javascript
运行
复制
Setting up udev (245.4-4ubuntu3.10) ...  
Failed to restart udev.service: Unit systemd-udevd.service is not loaded properly: Exec format error.  
See system logs and 'systemctl status udev.service' for details.  
invoke-rc.d: initscript udev, action "restart" failed.  
 systemd-udevd.service - udev Kernel Device Manager  
   Loaded: error (Reason: Exec format error)  
   Active: inactive (dead)  
     Docs: man:systemd-udevd.service(8)  
           man:udev(7)  
Aug 12 12:00:59 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:01:00 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:09:00 AtomServer systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.  
Aug 12 12:10:38 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:10:38 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:10:38 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:11:50 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:11:51 AtomServer systemd[1]: systemd-udevd.service: Cannot add dependency job, ignoring: Unit systemd-udevd.service is not loaded properly: Exec format error.  
Aug 12 12:11:51 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
Aug 12 12:11:51 AtomServer systemd[1]: /lib/systemd/system/systemd-udevd.service:26: Executable path is not absolute: udevadm control --reload --timeout 0  
dpkg: error processing package udev (--install):  
 installed udev package post-installation script subprocess returned error exit status 1  
Processing triggers for systemd (237-3ubuntu10.44) ...  
Processing triggers for ureadahead (0.100.0-21) ...  
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...  
Errors were encountered while processing:  
 udev  

有什么帮助吗?

谢谢

编辑输出apt-获取更新:

代码语言:javascript
运行
复制
Hit:1 http://gb.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Fetched 328 kB in 2s (140 kB/s)
Reading package lists... Done
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2021-08-12 11:47:13

UPD

看来你想安装错误的udev版本。有关仿生的下载和安装http://mirrors.kernel.org/ubuntu/pool/main/s/systemd/udev_237-3ubuntu10.50_amd64.deb

您可以尝试注释掉行/lib/systemd/system/systemd-udevd.service:26,直到升级完成为止。

代码语言:javascript
运行
复制
sudo sed -i '/ExecReload/s/.*/#\0/g' /lib/systemd/system/systemd-udevd.service


sudo systemctl daemon-reload

而不是再升级一次

代码语言:javascript
运行
复制
sudo do-release-upgrade
票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1357563

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档