12

用 aptitude 找出合適的降版組合

 1 year ago
source link: https://blog.gslin.org/archives/2023/05/10/11179/%e7%94%a8-aptitude-%e6%89%be%e5%87%ba%e5%90%88%e9%81%a9%e7%9a%84%e9%99%8d%e7%89%88%e7%b5%84%e5%90%88/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

用 aptitude 找出合適的降版組合

在跟 Nvidia 提供的各種驅動程式以及套件奮戰,結果遇到經典的 apt 每次都講的不明不白的老問題,像是依照「NVIDIA Deep Learning TensorRT Documentation」這篇的說明,你需要指定需要的版本安裝對應的套件,像是我這邊就是要裝 CUDA 11 的版本,但系統就跟你說不能裝:

sudo apt install tensorrt=8.5.3.1-1+cuda11.8
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 tensorrt : Depends: libnvinfer8 (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvinfer-plugin8 (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvparsers8 (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvonnxparsers8 (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvinfer-bin (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvinfer-dev (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvinfer-plugin-dev (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvparsers-dev (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvonnxparsers-dev (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
            Depends: libnvinfer-samples (= 8.5.3-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
E: Unable to correct problems, you have held broken packages.

以前比較簡單的套件可以用 apt-cache showpkg 慢慢看組合自己解,但這種巨大套件實在沒辦法。

在「How do I resolve `The following packages have unmet dependencies`」這邊則是有提到這個問題,下面有給個一般性的通解:用 aptitude 提供降版的組合,每一套組合你都可以選 n 讓他提供另外一套組合,直到你覺得這套組合 OK 了再選擇 y 讓他裝起來。

然後裝完以後記得用 apt-mark hold 把主套件的版本固定住,避免 upgrade 的時候又被搞中爛掉出事。

Related

Debian 的 Backports

這幾天在 VirtualBox 內弄了一台 Debian lenny (x86) 起來玩,想要多熟悉 Debian 與 bash 的風格... 不過 lenny (5.0.0) 從去年二月到現在也已經過了一年,雖然一直有在更新 (現在是 5.0.4),但為了穩定性,並不是所有的軟體都有更新。印象中有個計畫是專門解決這個問題的,可以讓你在 stable 使用新版,但不是整個系統都換到 testing 或 unstable。 在印象中跟 "backport" 這個關鍵字有關,翻了以後找到 Debian Backports,看起來就是我要的... 依照「instructions [Debian Backports]」操作,直接把 entry 加到 /etc/apt/sources.list 內,用 apt-get update 更新一次,這時候會出現不認得 public key,不管他直接 apt-get install debian-backports-keyring 就收工了。測過沒問題後,就在「Backports.org worldwide mirror sites」這邊找亞洲區的 mirror site,看起來只有日本有做,改過去再測一次 update,沒問題收工... 由於預設仍然會使用…

March 12, 2010

In "Computer"

在 Ubuntu 20.04/22.04 下使用 18.04 的 chromium-browser

Ubuntu 20.04 之後包的 chromium 都是基於 snap 的方案,是個除了 Canonical 的人以外沒人愛的東西,所以大家都在找方法改回 .deb 的版本。 剛剛因為需要測試東西所以才需要找這個方案,發現有個還蠻有趣的解法,是拿 18.04 的 chromium-browser 的套件來裝,因為官方至少會支援到 2023/04:「Is it still possible to install Chromium as a deb-package on 20.04 LTS using some third-party repository?」。 一個 /etc/apt/sources.list.d/bionic-update.list: deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe 另外一個 /etc/apt/preferences.d/chromium-deb-bionic-updates: Package: chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra chromium-codecs-ffmpeg Pin: release a=bionic-updates Pin-Priority:…

August 16, 2022

In "Browser"

在 FreeBSD 上安裝 Merb 1.0

在上一篇提到 FreeBSD 上暫時因為 RubyGems 版本問題,沒辦法裝 Merb 1.0,我決定自己來惡搞... 一開始是想裝 Ruby 1.9,據說內建 RubyGems,但裝上去後發現內建的版本是 RubyGems 1.0.1,比 FreeBSD Ports 的還舊,還是自己動手把 Ports 裡的 RubyGems 升級好了... 要將 FreeBSD Ports 裡的 RubyGems 更新到 1.3.1,最麻煩的是要生出 pkg-plist,這點由 ports maintainer jw at innerewut.de 做的差不多了,他寫了 x-generate-plist 會幫你產生 pkg-plist,所以很容易就把 pkg-plist 做完然後 send-pr。(參考 ports/128731: [PATCH] devel/ruby-gems: update to 1.3.1,裡面有 patch file) 升級完成後就是要裝 Merb…

November 10, 2008

In "Computer"

a611ee8db44c8d03a20edf0bf5a71d80?s=49&d=identicon&r=gAuthor Gea-Suan LinPosted on May 10, 2023Categories Computer, Linux, Murmuring, OS, SoftwareTags apt, aptitude, debian, linux, ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK