Windows 10 WSL Fedora 版本升级

10 4月

WSL与常规Linux环境不同,没有了开机、重启的过程,传统的使用fedup及dnf system-upgrade的方式在执行dnf system-upgrade reboot的时候会卡住,无法进行下一步。

Linux基于包管理的特性反而使得在WSL环境下的升级变得更加简单,使用如下命令:

sudo dnf update --releasever=28

本次升级基于Fedora 27版本,如需要升级到其它版本,将上述命令的28变更为其它版本即可。

命令完成后,直接关闭shell,重新打开Shell即完成了升级。

升级后,使用dnf出现了一个问题,因未尝试做重现,无法判断是否与升级相关,即使用dnf命令会报以下错误,dnf的安装、删除操作均无法完成:

Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Failed to obtain the transaction lock (logged in as: root).
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Could not run transaction.

解决办法为删除/var/lib/rpm/.rpm.lock 文件

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注