• [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 add
    
    apt-cdrom -m -d=/mnt/debian2 add
    
    apt-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]
  • 相关阅读:
    小学四则运算APP 最后阶段
    小学四则运算APP 第三阶段冲刺-第一天
    小学四则运算APP 第二阶段冲刺-第五天
    小学四则运算APP 第二次冲刺 第四天
    小学四则运算APP 第二阶段冲刺-第三天
    小学四则运算APP 第二次冲刺-第二天
    小学四则运算APP 第二个冲刺 第一天
    小学四则运算APP 第一个冲刺 第八天
    小学四则运算APP 第一个冲刺 第七天
    小学四则运算APP 第一个冲刺阶段 第六天
  • 原文地址:https://www.cnblogs.com/alfredsun/p/10751094.html
Copyright © 2020-2023  润新知