• 欢迎访问窗外天空网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 本站兼容IE9+,谷歌Chrome,火狐Firefox等主流浏览器

使用apt-mirror镜像ubuntu debian 软件源

Linux nixon li 291次浏览 0个评论 扫描二维码

安装软件

~$ 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]... 

到此文件已经在同步完成了。


版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明使用apt-mirror镜像ubuntu debian 软件源
喜欢 ( 0)
微信扫码
支付宝扫码
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址