0

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/

Could someone with a better idea help me to download the repo to use it offline?

  • 1
    wgetrespects the robots.txt file when crawling recursively through web sites. You can override this behaviour with -e robots=off (see codenimbus.com/2010/08/02/override-robots-txt-with-wget) – ridgy Dec 29 '17 at 16:58
  • Yeap, I see the robots.txt "disable" many of the folder to download (recursively?)...thanks for giving the quick questions...let my try – k.Cyborg Dec 29 '17 at 17:08
  • That seems to work flawlessly!!! Thanks! – k.Cyborg Dec 29 '17 at 17:42
1

You may be better off using debmirror instead of tryign to use wget since things won't all be linked, etc.

Here's the script I use to run debmirror note that you'll want to change the architecture, section, release, etc.

#!/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
  • Wow! This script seems to be very useful! Let me modify and try it! Thanks!!!! – k.Cyborg Dec 29 '17 at 17:13
0

wget respects the robots.txt file when crawling recursively through web sites. You can override this behaviour with -e robots=off More info here

Thanks to @ridgy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.