尝试用 Mint 替换 Ubuntu 时出现问题

尝试用 Mint 替换 Ubuntu 时出现问题

我尝试过用 Linux Mint 替换 Ubuntu。我使用 制作了一个文件(installed.list) apt list --installed > installed.list。它使用已安装的软件包创建了一个文件。之后,我安装了 linux Mint 和 Ubuntu。然后我复制了/家文件夹(包括点文件)到 Mint。我尝试installed.list使用 再次从文件安装软件包sudo apt install $(cut -d'/' -f1 installed.list)。我收到此错误E: Unable to locate package,它是我尝试安装的每个包的名称。

输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package snapd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libgc1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libgc1c2:i386 libgc1c2

Package virtualbox-6.1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package Listing...
E: Unable to locate package 4kvideodownloader
E: Unable to locate package bsdextrautils
E: Unable to locate package code
E: Unable to locate package jdk-16
E: Unable to locate package libcdio19
E: Unable to locate package libdav1d4
E: Unable to locate package libdav1d4
E: Unable to locate package libdns-export1110
E: Unable to locate package libdvdread8
E: Unable to locate package libebml5
E: Unable to locate package libedataserver-1.2-25
E: Unable to locate package libffi8ubuntu1
E: Unable to locate package libffi8ubuntu1
E: Unable to locate package libfm-qt7
E: Package 'libgc1' has no installation candidate
E: Unable to locate package libgnustep-base1.27
E: Unable to locate package libgpaste13
E: Unable to locate package libhandy-1-0
E: Unable to locate package libhfstospell11
E: Unable to locate package libhogweed6
E: Unable to locate package libhogweed6
E: Unable to locate package libicu67
E: Unable to locate package libicu67
E: Unable to locate package libilmbase25
E: Unable to locate package libjson-c5
E: Unable to locate package liblibreoffice-java
E: Unable to locate package libmatroska7
E: Unable to locate package libmetacity3
E: Unable to locate package libmetrics-any-perl
E: Unable to locate package libmutter-7-0
E: Unable to locate package libnettle8
E: Unable to locate package libnettle8
E: Unable to locate package libnma-common
E: Unable to locate package libnsl-dev
E: Unable to locate package libnsl2
E: Unable to locate package libnsl2
E: Unable to locate package libnss-nis
E: Unable to locate package libnss-nis
E: Unable to locate package libnss-nisplus
E: Unable to locate package libnss-nisplus
E: Unable to locate package libopenexr25
E: Unable to locate package liborcus-parser-0.15-0
E: Unable to locate package libplacebo72
E: Unable to locate package libpoppler102
E: Unable to locate package libpoppler102
E: Unable to locate package libprotobuf-lite23
E: Unable to locate package libprotobuf23
E: Unable to locate package libqpdf28
E: Unable to locate package libqt5qmlmodels5
E: Unable to locate package libqt5qmlworkerscript5
E: Unable to locate package libreoffice-style-yaru
E: Unable to locate package libsrt1-gnutls
E: Unable to locate package libtepl-5-0
E: Unable to locate package libtest-metrics-any-perl
E: Unable to locate package libx264-160
E: Unable to locate package libx264-160
E: Unable to locate package libx265-192
E: Unable to locate package libx265-192
E: Unable to locate package libx86emu3
E: Unable to locate package linux-headers-5.8.0-50
E: Unable to locate package linux-headers-5.8.0-53
E: Unable to locate package microsoft-edge-beta
E: Unable to locate package rpcsvc-proto
E: Package 'snapd' has no installation candidate
E: Unable to locate package ubuntu-wallpapers-groovy
E: Package 'virtualbox-6.1' has no installation candidate
E: Unable to locate package vivaldi-stable
E: Unable to locate package wps-office
E: Unable to locate package zoom

已安装列表:

Listing...
4kvideodownloader/now 4.15-1 amd64 [installed,local]
a11y-profile-manager-indicator/groovy,now 0.1.11-0ubuntu4 amd64 [installed,automatic]
accountsservice-ubuntu-schemas/groovy,groovy,now 0.0.7+17.10.20170922-0ubuntu1 all [installed,automatic]
accountsservice/groovy-updates,groovy-security,now 0.6.55-0ubuntu13.2 amd64 [installed,automatic]
acl/groovy,now 2.2.53-8 amd64 [installed,automatic]
acpi-support/groovy,now 0.143 amd64 [installed,automatic]
acpid/groovy,now 1:2.0.32-1ubuntu1 amd64 [installed,automatic]
activity-log-manager/groovy,now 0.9.7-0ubuntu27 amd64 [installed,automatic]
adcli/groovy-updates,groovy-security,now 0.9.0-1ubuntu1.2 amd64 [installed,automatic]
adduser/groovy,groovy,now 3.118ubuntu2 all [installed,automatic]
adium-theme-ubuntu/groovy,groovy,now 0.3.4-0ubuntu4 all [installed,automatic]
adwaita-icon-theme/groovy,groovy,now 3.38.0-1ubuntu1 all [installed,automatic]
aisleriot/groovy,now 1:3.22.9-1 amd64 [installed,automatic]
alsa-base/groovy,groovy,now 1.0.25+dfsg-0ubuntu5 all [installed,automatic]
alsa-topology-conf/groovy,groovy,now 1.2.3-1 all [installed,automatic]
alsa-ucm-conf/groovy-updates,groovy-updates,now 1.2.2-1ubuntu5.2 all [installed,automatic]
alsa-utils/groovy,now 1.2.3-1ubuntu1 amd64 [installed,automatic]
amd64-microcode/groovy,now 3.20191218.1ubuntu1 amd64 [installed,automatic]
anacron/groovy,now 2.3-29 amd64 [installed,automatic]
apg/groovy,now 2.2.3.dfsg.1-5 amd64 [installed,automatic]
app-install-data-partner/groovy,groovy,now 19.04 all 

注意:还有更多,但几乎有 220.000 个字符。

原帖这里

答案1

要减少不可用软件包列表,您需要启用universe. e,g:jdk-16可从存储库中获取universe

sudo apt-add-repository universe
sudo apt update

许多软件包无法安装在 Linux Mint 上,因为这些软件包仅在 Ubuntu Groovy 及更高版本上可用,而您的 Linux Mint 版本基于 Ubuntu Focal。

答案2

您跳过了太多步骤,首先过滤掉所有 lib 文件,除了少数例外,它们是另一个包的依赖项,并且在安装主包时将拉入正确的版本:

dpkg -l | awk '$2 !~ /^lib|zoom|microsoft/ {print $2}' > installed.txt

此命令使用 dpkg -l [list packages],然后获取第二列中且不以 lib 开头或包含 Zoom 或 microsoft 的所有项目并将其打印出来。

然后,您可以手动扫描该列表并删除任何明显特定于 ubuntu 的软件包,例如 ubuntu 壁纸。

请注意,除非 apt 中发生了某些更改,否则 apt install 会映射到 apt-get install,并且如果您尝试安装并非所有均可安装的软件包列表,它将无法工作,并且会因为失败而直接退出。如果列表中的任何内容都没有作为您正在使用的池中的包出现,则会导致失败。

当我以前做这样的事情时,我会循环遍历列表,并 apt-get 安装列表中的每个包以避免这个问题。

for item in $(cat installed.txt);do apt-get --no-install-recommends install $item;done

您可以强制接受所有软件包并且不使用选项 -y 询问,但这是一个坏主意,因为您想控制实际安装的内容。基本上,每次询问是否要安装额外的依赖项时,您只需按 Enter 键即可,不需要很长时间即可浏览列表。

请注意,您想使用 --no-install-recommends 禁用安装推荐,否则您最终会陷入可怕的混乱。我总是在 /etc/apt 配置中禁用它,但这超出了您的问题范围。

另外,值得注意的是,在安装另一个软件包时,apt 本身会跟踪它作为依赖项引入的软件包,并且当这些软件包在升级过程中被更新版本替换时,那些现在过时的软件包将被 apt-get remove 卸载以清理系统。如果您直接使用 apt-get install 安装特定编号的库版本,即使它们存在于池中,当它们被更新版本替换时,apt 也可能不会提供删除它们的功能。这可能会导致系统混乱。

Mint 一般都有旧软件包,您不能指望这两个软件包池实际上匹配,尽管它们的最新版本并不像一两年后那么旧。

请注意,您可以通过以下方式粗略地判断这对您来说会有多糟糕:

inxi -r

它将列出您当前的存储库,您拥有的 PPA 越多,情况就会变得越糟。零 PPA 是理想的数字,但如果你有很多,它只会变得混乱,但循环安装命令将避免大多数最糟糕的部分。

我并不真正使用 Mint,所以我不记得他们是如何做 PPA 的,但它几乎肯定会失败,因为 ubuntu 和 mint 不兼容,它们在 Mint 的 Ubuntu 版本和你正在安装的 Mint 之间共享许多软件包,但是在安装循环包之前,您将不断遇到失败。

相关内容