aptはdebian 11 Bullseyeをアップデートするときに「deb.debian.org」を確認できません。

aptはdebian 11 Bullseyeをアップデートするときに「deb.debian.org」を確認できません。

Debian 11 Bullseyeをインストールしましたが、これは私のsource.listファイルです:

deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free

deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

更新を使用しようとすると、apt update次のエラーが発生します。

Err:1 http://deb.debian.org/debian bullseye InRelease
Could not resolve 'deb.debian.org'
Err:2 http://security.debian.org.debian-security bullseye InRelease
Could not resolve 'deb.debian.org'
Err:3 http://deb.debian.org/debian bullseye-updates InRelease
Could not resolve 'deb.debian.org'
Err:4 http://security.debian.org.debian bullseye-backports InRelease
Could not resolve 'deb.debian.org'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease Could not resolve 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/bullseye-security/InRelease Could not resolve 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease Could not resolve 'deb.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-backports/InRelease Could not resolve 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

私のsource.listファイルに何の問題がありますか?また設定がありますか?

ベストアンサー1

rootにコピーします/etc/resolv.conf(CLI cp /etc/resolv.conf /etc/resolv.conf.orig)。次に、次のコマンドを実行します。

# printf '%s\n' 'nameserver 1.1.1.1' 'nameserver 1.0.0.1' > /etc/resolv.conf
# ping -c 4 deb.debian.org; printf 'Return code: %s\n' "$?"

最後の行があればReturn code: 0正しくapt update機能します。

おすすめ記事