1、配置apt-mirror配置文件
cat>/etc/apt/apt-mirror<<EOF root@Huawei-sources-list:/etc/apt# cat mirror.list ############# config ################## # #set base_path /var/www/html/18.04.5/ # 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 ############## # 18.04.5 deb http://repo.huaweicloud.com/ubuntu-ports/ bionic main restricted universe multiverse deb http://repo.huaweicloud.com/ubuntu-ports/ bionic-updates main restricted universe multiverse deb http://repo.huaweicloud.com/ubuntu-ports/ bionic-backports main restricted universe multiverse deb http://repo.huaweicloud.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse deb http://repo.huaweicloud.com/ubuntu-ports/ bionic-security main restricted universe multiverse clean http://archive.huaweicloud.com/ubuntu-ports/ EOF
cat>/etc/apt/source.list<<'EOF' ############# config ################## # set base_path /var/www/html/ # 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://repo.huaweicloud.com/ubuntu-ports/ focal main restricted deb http://repo.huaweicloud.com/ubuntu-ports/ focal-updates main restricted deb http://repo.huaweicloud.com/ubuntu-ports/ focal universe deb http://repo.huaweicloud.com/ubuntu-ports/ focal-updates universe deb http://repo.huaweicloud.com/ubuntu-ports/ focal multiverse deb http://repo.huaweicloud.com/ubuntu-ports/ focal-updates multiverse deb http://repo.huaweicloud.com/ubuntu-ports/ focal-backports main restricted universe multiverse deb http://repo.huaweicloud.com/ubuntu-ports/ focal-security main restricted deb http://repo.huaweicloud.com/ubuntu-ports/ focal-security universe deb http://repo.huaweicloud.com/ubuntu-ports/ focal-security multiverse clean http://archive.huaweicloud.com/ubuntu-ports/ EOFUbuntu20.04
2、执行下载
nohup apt-mirror &
标签:http,离线,repo,huaweicloud,ubuntu,镜像,Ubuntu18.04,com,ports From: https://www.cnblogs.com/vmsysjack/p/17803467.html