How to use an ISO file as offline repository in Debian

来自linux中国网wiki
Evan讨论 | 贡献2020年9月10日 (四) 02:39的版本 (创建页面,内容为“* ** Create the folders (mountpoint) to mount the ISO files <pre>sudo mkdir -p /media/repo_1 sudo mkdir -p /media/repo_2 sudo mkdir -p /media/repo_3 </pre> ** Debi…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索
    • Create the folders (mountpoint) to mount the ISO files
sudo mkdir -p /media/repo_1
sudo mkdir -p /media/repo_2
sudo mkdir -p /media/repo_3 
    • Debian ISO image downloaded at the location /root
cd /root &&  wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-1.iso

wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-2.iso

wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-3.iso
    • mount the ISO files
      • temp
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_1/
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_2/
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_3/
      • forever
    • edit the /etc/apt/sources.list file to add the repository
deb [trusted=yes]  file:///media/repo_1/  buster  main contrib
deb [trusted=yes]  file:///media/repo_2/  buster  main contrib
deb [trusted=yes]  file:///media/repo_3/  buster  main contrib 


  • 快速查看每个 iso的软件
ls /media/repo_1/pool/main/
eg  ls /media/repo_1/pool/main/z/  得知有 zip    apt install zip
  • see also

How to use an ISO file as offline repository in Debian


  • trouble

Reading package lists... Done
E: The repository 'file:/media/repo_1 buster Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@cailuw-test:~#

You should tell apt it's a trusted source:

deb [trusted=yes] file:///media/repo_1/  buster  main contrib