BusterとSIDのリポジトリがある場合は、適切なアップデートとアップグレードで特定のバージョンのパッケージをどのようにインストールしますか?

BusterとSIDのリポジトリがある場合は、適切なアップデートとアップグレードで特定のバージョンのパッケージをどのようにインストールしますか?

注目!学業に関する業務に関する質問です。先生はこの作業に対する解決策がないかもしれませんが、パッケージ管理方法を学ぶためにはすべての努力を払わなければならないと言われました。つまり、「解決策はありません」と答えないでください。解決策がない場合は理由をお知らせください。半分程度の解決方法がある場合はお知らせください。
読んでくれてありがとう

シーンの説明

私の仮想マシンはDebian 10を実行しており、その中に/etc/apt/sources.listBusterとSIDのバージョン用のリポジトリがあります。
ここに私のものがあります。sources.list

# 

# deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official amd64 NETINST 20190706-10:23]/ buster main

#deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official amd64 NETINST 20190706-10:23]/ buster main

deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main

deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

#SID repos
deb http://deb.debian.org/debian sid main
deb-src http://deb.debian.org/debian sid main

第二に、私の/etc/apt/preferences.dディレクトリにはというディレクトリがありますsid_priority。以下はその内容です。

Package: *
Pin: release a=sid
Pin-Priority: -1

このファイルの説明

このファイルは、すべてのsidパッケージの優先順位を-1に下げるためのものです。したがって、実行すると、sudo apt update最終的にsudo apt upgradeBusterパッケージのみをインストールしてアップグレードします。 sidリポジトリは、手動インストールおよびアップグレード(たとえば、実行)にのみ使用されます。sudo apt install(また、パッケージの優先順位がどのように機能するかはほとんど分からず、インターネットを少し見ただけで、基本の基本のみを理解できます。)。

私は何を達成したいと思うか。

デフォルトでは、Busterリポジトリを介してのみインストールしてアップグレードしたいと思います。つまり、sudo apt update' orsudo apt update , I'm not going to install any sid packages. I'll just install sid packages if I runsudo apt installを実行すると、

私に何が起こったのか

優先順位は有効だと思いましたが、実行を通じてsudo apt upgrade最終的にsidパケットを受け取りました。次の例を見ることができます。

libc6:
  Installed: 2.29-2
  Candidate: 2.29-2
  Version table:
 *** 2.29-2 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
        100 /var/lib/dpkg/status
     2.28-10 500
        500 http://deb.debian.org/debian buster/main amd64 Packages

しかし、あなたが望むものを提案することを恐れないでください。なぜなら、私は仮想マシンで作業していて、この作業に特別に仮想マシンを使用しているからです。削除する必要がある場合は削除します。
ご協力ありがとうございます

ベストアンサー1

マニュアルページの最初の例は、あなたの質問に対する答えです。

はい

トレースは安定しています。

次のAPT設定ファイルは、APTが信頼できるディストリビューションに属するすべてのパッケージバージョンにデフォルト値(500)より高い優先順位を割り当て、他のDebianディストリビューションに属するパッケージバージョンに非常に低い優先順位を割り当てます。

説明:安定版リリース以外のDebian派生パッケージのバージョンを削除またはインストールしません。

Package: *
Pin: release a=stable
Pin-Priority: 900
Package: *
Pin: release o=Debian
Pin-Priority: -10

あなたはsid_preference次のようにする必要があります:

Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release o=Debian
Pin-Priority: -1

確認する:

sudo apt update
apt policy libc6

出力例:

libc6:
  Installed: 2.28-10
  Candidate: 2.28-10
  Version table:
     2.29-2 -1
         -1 http://deb.debian.org/debian sid/main amd64 Packages
 *** 2.28-10 900
        900 http://deb.debian.org/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status

man apt_preferences:

the Origin: line

names the originator of the packages in the directory tree of 
the Release file. Most commonly, this is Debian. Specifying this
origin in the APT preferences file would require the line:

    Pin: release o=Debian

おすすめ記事