嘗試用 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 之間共享許多軟體包,但是在安裝循環包之前,您將不斷遇到失敗。

相關內容