如何從 Debian sid 安裝單一軟體套件?

如何從 Debian sid 安裝單一軟體套件?

以 ibus-sunpinyin 為例,squeeze 版本中不存在該功能。我不會將整個系統切換到 sid 分支,因此,我想從 sid 儲存庫下載單一套件並安裝它,如下所示:

# Add the sid repository
sudo mv /tmp/sid.list /etc/apt/sources.list.d/

# Error: can't install because version conflicts of libc6:
#     sudo apt-get install ibus-sunpinyin

# This is ok but it will upgrade a lot of mess from sid branch:
#     sudo apt-get upgrade ibus-sunpinyin

# So, instead of apt-get install/upgrade, let me download & install the single package.
# However, this errored again because of version conflicts of libc6:
#      apt-get install --download-only ibus-sunpinyin

## THEN, WHAT CAN I DO? ##

# Remove the sid repository.
sudo mv /etc/apt/sources.list.d/sid.list /tmp

# Install the single package.
sudo dpkg -i ./ibus-sunpinyin-x.x.x.deb

答案1

您也可以嘗試從 sid 儲存庫下載來源包,並在您的 freeze 系統上建置它們。如果有很多依賴項,或者套件依賴在squeeze中不可用的庫版本,您可能會遇到麻煩。

如果這有效,那麼您不需要像使用引導方法那樣在單獨的資料夾中維護另一個發行版。

答案2

你真正想要的是了解 apt-pinning。http://jaqque.sbih.org/kplug/apt-pinning.html

答案3

一種簡單的方法是設定首選項,以便系統使用stable大多數包,但回退到testingunstable遺失的包。

步驟如下:

  1. 將其添加到/etc/apt/sources.list

    deb http://deb.debian.org/debian buster main
    deb http://deb.debian.org/debian testing main non-free contrib
    deb http://deb.debian.org/debian unstable main non-free contrib
    
  2. 將其寫入/etc/apt/preferences(或建立文件)

    Package: *
    Pin: release a=stable
    Pin-Priority: 700
    
    Package: *
    Pin: release a=testing
    Pin-Priority: 650
    
    Package: *
    Pin: release a=unstable
    Pin-Priority: 600
    
  3. 跑步apt-get update

  4. 安裝你想要的套件(例如apt-get install ibus-sunpinyin

PS:您可以強制安裝不穩定封裝有apt-get install <package>/unstable

答案4

解決此問題的一種方法是cdebootstrap安裝基本的 sid 系統,然後chroot在新系統中執行您需要的程式。

cdebootstrap從您想要在目錄中的任何發行版安裝新的 debian 系統。然後,chroot讓您可以執行其他發行版中的程序,而無需重新啟動或執行任何操作。

您也可以使用mount --bindchroot 系統存取您的主資料夾、/proc 等。

在 chroot 系統中,apt-get 將從 sid 儲存庫安裝。

更詳細的解釋請參見https://wiki.ubuntu.com/DebootstrapChroot

相關內容