![我正在尝试更新 ubuntu,但没有成功](https://linux22.com/image/944286/%E6%88%91%E6%AD%A3%E5%9C%A8%E5%B0%9D%E8%AF%95%E6%9B%B4%E6%96%B0%20ubuntu%EF%BC%8C%E4%BD%86%E6%B2%A1%E6%9C%89%E6%88%90%E5%8A%9F.png)
我遇到了这个问题,但我不知道该怎么办,我尝试了几种方法,但还是没能解决。你能帮助我吗?
输出sudo apt update; sudo apt -f install
:
$ sudo apt update; sudo apt -f install
Hit:1 http://gb.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://gb.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://archive.canonical.com/ubuntu focal InRelease
Hit:5 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal InRelease
Hit:6 http://gb.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:7 http://ppa.launchpad.net/lutris-team/lutris/ubuntu focal InRelease
Get:8 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease [6,263 B]
Hit:9 http://download.opensuse.org/repositories/home:/strycore/Debian_10 ./ InRelease
Hit:10 https://linux.teamviewer.com/deb stable InRelease
Hit:11 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:12 https://ocean.surfshark.com/debian stretch InRelease
Hit:13 https://packages.microsoft.com/ubuntu/20.04/mssql-server-2019 focal InRelease
Hit:14 https://packages.microsoft.com/repos/ms-teams stable InRelease
Hit:15 http://packages.ros.org/ros/ubuntu focal InRelease
Get:16 https://dl.winehq.org/wine-builds/ubuntu bionic/main amd64 Packages [939 kB]
Get:17 https://dl.winehq.org/wine-builds/ubuntu bionic/main i386 Packages [975 kB]
Fetched 1,920 kB in 2s (877 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
59 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
python3-catkin
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
python3-catkin-pkg-modules
The following NEW packages will be installed
python3-catkin-pkg-modules
0 to upgrade, 1 to newly install, 0 to remove and 59 not to upgrade.
500 not fully installed or removed.
Need to get 0 B/42.4 kB of archives.
After this operation, 254 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 399552 files and directories currently installed.)
Preparing to unpack .../python3-catkin-pkg-modules_0.4.24-1_all.deb ...
Unpacking python3-catkin-pkg-modules (0.4.24-1) ...
dpkg: error processing archive /var/cache/apt/archives/python3-catkin-pkg-module
s_0.4.24-1_all.deb (--unpack):
trying to overwrite '/usr/lib/python3/dist-packages/catkin_pkg/__init__.py', wh
ich is also in package python3-catkin-pkg 0.4.16-1
Errors were encountered while processing:
/var/cache/apt/archives/python3-catkin-pkg-modules_0.4.24-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您遇到的具体问题确实明显重复了dpkg 错误:“尝试覆盖文件,该文件也在……”,但有一个潜在的问题:您的系统上有许多来自多个非 Ubuntu 源的新软件,这些软件被绑定到较旧的 LTS 上。我们称之为“Frankensystem”。
- LTS 版本五年内稳定且安全如果你不改变软件。
- Frankensystems 往往不稳定,各种来源经常提供冲突彼此……这正是你所面临的问题。
- 一般来说,大多数想要更新软件的人如果使用较新版本的 Ubuntu,或者使用 snap 而不是 deb 安装较新的软件,将获得最佳体验。