[debian]use ISO as debian apt source / 使用ISO文件作为apt源
準備文件:
debian-9.8.0-amd64-DVD-1.iso
debian-9.8.0-amd64-DVD-2.iso
debian-9.8.0-amd64-DVD-3.iso
掛載:
?
root@debian:~# mount -t iso9660 -o loop /debian/debian-9.8.0-amd64-DVD-1.iso /mnt/debian1
mount: /dev/loop0 is write-protected, mounting read-only
root@debian:~# mount -t iso9660 -o loop /debian/debian-9.8.0-amd64-DVD-2.iso /mnt/debian2
mount: /dev/loop1 is write-protected, mounting read-only
root@debian:~# mount -t iso9660 -o loop /debian/debian-9.8.0-amd64-DVD-3.iso /mnt/debian3
mount: /dev/loop2 is write-protected, mounting read-only
查看mount:
/dev/sda1 on /home type ext4 (rw,relatime,data=ordered)
tmpfs on /run/user/108 type tmpfs (rw,nosuid,nodev,relatime,size=405056k,mode=700,uid=108,gid=113)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=405056k,mode=700)
/debian/debian-9.8.0-amd64-DVD-2.iso on /mnt/debian2 type iso9660 (ro,relatime)
/debian/debian-9.8.0-amd64-DVD-3.iso on /mnt/debian3 type iso9660 (ro,relatime)
/debian/debian-9.8.0-amd64-DVD-1.iso on /mnt/debian1 type iso9660 (ro,relatime)
修改/etc/fstab:
[defaults 可以改為 user,loop]
? 添加apt源:
#vim /etc/apt/sources.list
刪除這個文件
?
apt-cdrom -m -d=/mnt/debian1 addapt-cdrom -m -d=/mnt/debian2 addapt-cdrom -m -d=/mnt/debian3 add?
新增apt.conf
Acquire::cdrom::mount "/mnt/debian1"; Acquire::cdrom::mount "/mnt/debian2"; Acquire::cdrom::mount "/mnt/debian3"; APT::CDROM::NoMount;?
目前只能安裝第一張DVD中的包 如果在后兩個磁盤(如lsscsi)會提示需要插入磁盤:
root@debian:~# apt install lsscsi Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed:lsscsi 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/35.6 kB of archives. After this operation, 89.1 kB of additional disk space will be used. Media change: please insert the disc labeled'Debian GNU/Linux 9.8.0 _Stretch_ - Official amd64 DVD Binary-2 20190216-11:59' in the drive '/mnt/debian1/' and press [Enter]?
轉載于:https://www.cnblogs.com/alfredsun/p/10751094.html
總結
以上是生活随笔為你收集整理的[debian]use ISO as debian apt source / 使用ISO文件作为apt源的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python -yield理解
- 下一篇: equals问题