首頁 > 系統教程 > Linux > MMDEBSTRAP的故障排除指南:解決常見問題

MMDEBSTRAP的故障排除指南:解決常見問題

尊渡假赌尊渡假赌尊渡假赌
發布: 2025-03-06 10:41:16
原創
361 人瀏覽過

> mmdebstrap是一種以最小和高效的方式創建基於Debian的系統圖像(root Filesystems)的工具。它旨在簡單,快速且輕巧,非常適合為容器,虛擬機或嵌入式系統創建小型,定制的系統圖像。如果您經常使用MMDEBSTRAP創建最小的基於Debian的系統,則本指南將幫助您進行故障排除並修復您可能會遇到的最常見問題。

1。無法創建 /dev /null:權限拒絕

問題:

結論

Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
0% [Connecting to security.debian.org (2a04:4e42:400::644)]/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
E: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:1 http://deb.debian.org/debian bookworm InRelease      
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
0% [Waiting for headers]/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
E: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:2 http://deb.debian.org/debian bookworm-updates InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
0% [Working]/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
E: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:3 http://security.debian.org/debian-security bookworm-security InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian bookworm InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian bookworm-updates InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org/debian-security bookworm-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Failed to fetch http://deb.debian.org/debian/dists/bookworm/InRelease  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Failed to fetch http://deb.debian.org/debian/dists/bookworm-updates/InRelease  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Failed to fetch http://security.debian.org/debian-security/dists/bookworm-security/InRelease  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Some index files failed to download. They have been ignored, or old ones used instead.
登入後複製
登入後複製

MMDEBSTRAP的故障排除指南:解決常見問題> 1。無法創建 /dev /null:許可拒絕

>

問題:

>

當運行命令在chroot內部運行時,您會看到類似的錯誤,例如:

sudo mount --bind /dev /path/to/chroot/dev
登入後複製
登入後複製

sudo mount --bind /dev ~/debian-chroot/dev/
登入後複製
登入後複製

解決方案:

gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
登入後複製
登入後複製

替換/path/path/to/chroot to/chroot與您的Chroot所在的目錄。

>

sudo chroot /path/to/chroot apt update
sudo chroot /path/to/chroot apt install -y gpgv
登入後複製
登入後複製
example

example

The repository is not signed. Updating from such a repository can't be done securely.

2。缺少GPG工具(找不到GPGV)

>

問題:

>在運行APT更新時,您會看到錯誤:解決方案: 在chroot:3。存儲庫驗證錯誤問題:>運行APT UPDATE時,您會看到類似於: 解決方案:>>此錯誤發生,因為gpgv nist丟失或存儲鍵不信任。請按照以下步驟:
  1. 安裝gpgv(請參見上面的解決方案2)。
  2. >更新軟件包列表:
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
0% [Connecting to security.debian.org (2a04:4e42:400::644)]/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
E: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:1 http://deb.debian.org/debian bookworm InRelease      
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
0% [Waiting for headers]/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
E: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:2 http://deb.debian.org/debian bookworm-updates InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
0% [Working]/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
/usr/bin/apt-key: 95: cannot create /dev/null: Permission denied
E: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:3 http://security.debian.org/debian-security bookworm-security InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian bookworm InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian bookworm-updates InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org/debian-security bookworm-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Failed to fetch http://deb.debian.org/debian/dists/bookworm/InRelease  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Failed to fetch http://deb.debian.org/debian/dists/bookworm-updates/InRelease  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Failed to fetch http://security.debian.org/debian-security/dists/bookworm-security/InRelease  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
W: Some index files failed to download. They have been ignored, or old ones used instead.
登入後複製
登入後複製

>為什麼此功能:

gpgv是需要驗證包裝真實性的。沒有它,APT將無法安全地更新軟件包列表。

4。 CHROOT

sudo mount --bind /dev /path/to/chroot/dev
登入後複製
登入後複製
問題中的網絡問題:

命令如APT更新而因網絡錯誤而失敗,例如:

sudo mount --bind /dev ~/debian-chroot/dev/
登入後複製
登入後複製
解決方案:

CHROOT環境可能無法訪問主機的網絡配置。要解決此問題,請將主機的DNS設置複製到Chroot:

>為什麼起作用:

resolv.conf文件包含DNS設置。從主機複製它可確保Chroot可以解析域名。

5。

>缺少必需軟件包

問題:
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
登入後複製
登入後複製
> ls或bash之類的基本命令在chroot內部不起作用。

>

解決方案:

安裝基本的coreutils and bash and bash and bash and bash and bash:

sudo chroot /path/to/chroot apt update
sudo chroot /path/to/chroot apt install -y gpgv
登入後複製
登入後複製
問題:

>在使用chroot後,您忘記卸下 /dev,離開主機的 /dev目錄。狀態。

7。在創建chroot。

解決方案之後,使用mmdebstrap與-include

問題:
The repository is not signed. Updating from such a repository can't be done securely.
登入後複製
>問題:

您經常需要安裝相同的軟件包(例如gpgv,gnupg)。在創建過程中要安裝的其他軟件包,節省了時間和精力。

8。在測試後清理

問題:> 解決方案:

   sudo chroot /path/to/chroot apt update
登入後複製
始終刪除Chroot Directory the Chroot Directory,當您完成時:

Temporary failure resolving 'deb.debian.org'
登入後複製
清潔。

9。自動化過程(可選)
sudo cp /etc/resolv.conf /path/to/chroot/etc/resolv.conf
登入後複製

問題:

>您經常創建和測試chroots並想要自動化過程。例如:

>將此腳本保存為mmdebstrap-test.sh,使其可使用CHMOD x mmdebstrap-test.sh使其可執行,然後運行它: mmdebstrap是一種強大的工具,可以創建最小的系統,但要拖到最小的系統。通過遵循此故障排除指南,您可以快速解決常見問題並重新開始工作。記住:
    >
  1. >
  2. 安裝 /開機在Chroot內部。
  3. >安裝gpgv用於包裝驗證。
  4. >
  5. >如果需要,請複制主機的DNS設置。
  6. >
  7. >

>

> 在測試後清理以釋放磁盤空間以釋放磁盤空間。

以上是MMDEBSTRAP的故障排除指南:解決常見問題的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板