安装软件
~$ sudo apt-get install apt-mirror
编辑配置文件
~$ sudo gedit /etc/apt/mirror.list
因为我根分区内存不够大所有要更改镜像文件保存位置我的配置代码如下
############# config ################## # set base_path /home/apt-mirror #文件保存路径 # 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 # set postmirror_script $var_path/postmirror.sh # set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ############## deb http://cn.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse #deb-src http://cn.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse #deb-src http://cn.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse #deb-src http://cn.archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse #deb-src http://cn.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse clean http://archive.ubuntu.com/ubuntu
你可以指定下载deb包如果不设定直接下载的是你系统版本的包(32或64位)
可以设定为
############# config ################## # set base_path /home/apt-mirror #文件保存路径 # 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 # set postmirror_script $var_path/postmirror.sh # set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ############## deb-i386 http://cn.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse deb-i386 http://cn.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse deb-i386 http://cn.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse deb-i386 http://cn.archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse deb-i386 http://cn.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse deb-amd64 http://cn.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse deb-amd64 http://cn.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse deb-amd64 http://cn.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse deb-amd64 http://cn.archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse deb-amd64 http://cn.archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse clean http://archive.ubuntu.com/ubuntu
“deb-src”为源码文件
“deb-i386″为32位软件包
“deb-amd64″为64位软件包
开始下载软件包
运行apt-mirror开始下载文件
~$ sudo apt-mirror
运行后有以下提示
Downloading 162 index files using 20 threads... Begin time: Tue Jan 5 10:16:33 2016 [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Tue Jan 5 10:18:25 2016 Processing tranlation indexes: [TTT] Downloading 201 translation files using 20 threads... Begin time: Tue Jan 5 10:18:25 2016 [20]...[19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
到此文件已经在同步完成了。
未经允许不得转载:窗外天空 » 使用apt-mirror镜像ubuntu debian 软件源