从 Ubuntu Server 存储库制作镜像的疑问

从 Ubuntu Server 存储库制作镜像的疑问

Recently I bought an Orange Pi 2G IoT (this little SoC is really great!). I installed the Ubuntu Server and managed to connect to it through the serial port and I could even update the system (only apt-get update) and install some packages, but here's the little problem: I would like to install packages offline (in my house I do not have an internet connection) and I tried to download the repository but it only lets me download about 9 megabytes and don't even start with the "pool" files where (I think) reside the packages, it only make a list of the files in that repo and download some of the "index.html" but nothing more.

I am using a PC with Debian Jessie amd64, I situate in a folder in a NTFS partition (check that I have enough space) and I have tried to mirror the repository from the console using the wget command, with the following syntax:

wget --mirror --convert-links --show-progress --recursive --wait=5 http://mirrors.ustc.edu.cn/ubuntu-ports/

有更好主意的人可以帮我下载该存储库以离线使用吗?

答案1

您可能最好使用debmirrorwget 而不是 tryign,因为事情不会全部链接起来,等等。

这是我用来运行的脚本,debmirror请注意您需要更改架构、部分、版本等。

#!/bin/sh

# Architecture (i386, powerpc, amd64, etc.)
arch=i386,amd64

# Section (main,contrib,non-free)
section=main,multiverse,universe,restricted,partner

# Release of the system (squeeze,lenny,stable,testing,etc)
release=xenial,xenial-backports,xenial-proposed,xenial-security,xenial-updates,yakkety,yakkety-backports,yakkety-proposed,yakkety-security,yakkety-updates,zesty,zesty-backports,zesty-proposed,zesty-security,zesty-updates,artful,artful-updates,artful-security,artful-proposed,artful-backports

# Server name, minus the protocol and the path at the end
server=us.archive.ubuntu.com

# Path from the main server, so http://my.web.server/$dir, Server dependant
inPath=/ubuntu

# Protocol to use for transfer (http, ftp, hftp, rsync)
proto=http

# Directory to store the mirror in
outPath=/storage/mirrors/mirror/archive.ubuntu.com/ubuntu

logfile=ubuntu-mirror.log-`date +%m-%d-%Y`

# Start script

debmirror -a $arch \
--no-source \
--slow-cpu \
--i18n \
--md5sums \
--progress \
--passive \
--verbose \
-s $section \
-h $server \
-d $release \
-r $inPath \
-e $proto \
$outPath 

# pull in all the Release.gz etc. stuff
for i in `echo $release | sed s/\,/\ /g`
do
     rsync -avrt rsync://us.archive.ubuntu.com/ubuntu/dists/$i $outPath/dists
done

# fix Translation files
cd $outPath/dists
for i in `find ./ -iname Translation-en.gz`
    do nn=`echo $i | sed s/\.gz//g`
    zcat $i > $nn
done

答案2

wget在网站上递归爬行时遵循 robots.txt 文件。您可以使用-e robots=off 更多信息覆盖此行为这里

感谢@ridgy

相关内容