赞
踩
sudo apt-get install apt-mirror
mkdir ./apt_mirror_dir
sudo gedit /etc/apt/mirror.list
得到以下文件,重点对两个位置进行修改:
############# config ################## # ## 修改1: 镜像源文件的存储目录 set base_path /full/path/to/apt_mirror_dir # # 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 ############## ## 修改2: 把以下内容修改为国内的镜像源(比如这里是aliyun镜像源) deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted deb http://mirrors.aliyun.com/ubuntu/ bionic universe deb http://mirrors.aliyun.com/ubuntu/ bionic-updates universe deb http://mirrors.aliyun.com/ubuntu/ bionic multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted deb http://mirrors.aliyun.com/ubuntu/ bionic-security universe deb http://mirrors.aliyun.com/ubuntu/ bionic-security multiverse #这个脚本会清除上游服务器废弃的包的 clean https://mirror.aliyun.com/ubuntu
sudo apt-mirror
下载可能需要很长时间,等待就可以了
下载完成后,下载目录下面大概是下面的样子:
还没有具体实践,准备参考 ubuntu创建apt-mirror本地仓库 进行测试。
[1] https://blog.csdn.net/progrmmmm/article/details/134974440
[2] https://blog.csdn.net/siguoyi/article/details/118551337
[3] https://blog.csdn.net/yanjiee/article/details/85011779
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。