root@repository:/etc/apt# vim mirror.list.16.04 # configure 16.04 ############# config ################## # # set base_path /var/spool/apt-mirror set base_path /data/16.04 #设置下载指定路径 set defaltarch amd64 #指定版本 # # set mirror_path $base_path/mirror # set skel_path $base_path/skel # set var_path $base_path/var # set cleanscript $var_path/clean.sh # set defaultarch <running host architecture> # set postmirror_script $var_path/postmirror.sh # set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ##############deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
root@repository:/etc/apt# vim mirror.list.18.04 # configure 18.04 ############# config ################## # # set base_path /var/spool/apt-mirror set base_path /data/18.04 #设置下载指定路径 set defaltarch amd64 #指定版本 # # set mirror_path $base_path/mirror # set skel_path $base_path/skel # set var_path $base_path/var # set cleanscript $var_path/clean.sh # set defaultarch <running host architecture> # set postmirror_script $var_path/postmirror.sh # set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ##############deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
root@cli16:/etc/apt# cp -a sources.list sources.list.bak root@cli16:/etc/apt# >sources.list root@cli16:/etc/apt# vim sources.list deb [arch=amd64] http://192.168.16.130/ubuntu/16.04 xenial main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/16.04 xenial-security main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/16.04 xenial-updates main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/16.04 xenial-proposed main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/16.04 xenial-backports main restricted universe multiverse root@cli16:/etc/apt# root@cli16:/etc/apt# apt update
2、Ubuntu18.04 test
root@cli18:/etc/apt# cp -a sources.list sources.list.bak root@cli18:/etc/apt# > sources.list root@cli18:/etc/apt# vim sources.list deb [arch=amd64] http://192.168.16.130/ubuntu/18.04 bionic main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/18.04 bionic-updates main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/18.04 bionic-security main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/18.04 bionic-proposed main restricted universe multiverse deb [arch=amd64] http://192.168.16.130/ubuntu/18.04 bionic-backports main restricted universe multiverse root@cli18:/etc/apt# root@cli18:/etc/apt# apt update