Mirror Ubuntu repositories.

Asked by j-a-p

Is it possible to mirror the Ubuntu repositories to maintain a local current copy? I understand this can be achieved via rsync but I'm concerned about what is actually copied.
By this, I mean I only want x86 packages. From what I have read, the Ubuntu repositories contain packages for other architectures in the same directories as the x86 packages.

Please assist.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu debmirror Edit question
Assignee:
No assignee Edit question
Solved by:
Rolando Espinoza La Fuente
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
William Grant (wgrant) said :
#1

Try the package 'debmirror.' It enables you to select architectures, distributions, and handles all of the mirroring for you. I have used it in the past to mirror just the Breezy, binary x86 packages, with a command line somewhat like this:

debmirror -v -p --nosource --host=au.archive.ubuntu.com --method=http --root=ubuntu/ --dist=breezy --section=main,restricted,universe --arch=x86 ./mirror

Hope this helps.

Revision history for this message
j-a-p (j-a-p) said :
#2

Well, that looks tailor-made for the job.

Cheers william.

Revision history for this message
j-a-p (j-a-p) said :
#3

I've tried to use debmirror in a script like so:

#!/bin/sh

debmirror -v -p \
        --host=www.mirrorservice.org/sites/archive.ubuntu.com \
        --method=http \
        --root=ubuntu/ \
        --dist=breezy \
        --section=main,restricted,universe,multiverse \
        --arch=x86 /var/debmirror/

I get the following outout:

Mirroring to /var/mirrors/ubuntu from http://anonymous:www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu//
Arches: x86
Dists: breezy
Sections: main,restricted,universe,multiverse
Including source.
Attempting to get lock, this might take 2 minutes before it fails.
Get Release files.
Getting: dists/breezy/Release... ok
Getting: dists/breezy/Release.gpg... ok
gpg: Signature made Wed Nov 23 21:38:31 2005 GMT using DSA key ID 437D05B5
gpg: Can't check signature: public key not found
Release signature does not verify.
Get Packages and Sources files and other miscellany.
Won't mirror without dists/breezy/main/binary-x86/Packages.gz signature in Release at /usr/bin/debmirror line 1187.
releasing 1 pending lock... at /usr/lib/perl5/LockFile/Simple.pm line 182.

Any ideas?

Revision history for this message
Rolando Espinoza La Fuente (rolando+espinoza) said :
#4

Hi, i use this script:

#!/bin/bash -x

/usr/bin/debmirror --nosource -m --passive --host=archive.ubuntulinux.org \
                  --root=ubuntu/ --method=http --progress --dist=breezy \
                  --ignore-release-gpg --section=main,restricted,multiverse,universe \
                  --arch=i386 /ubuntumirror/

Revision history for this message
j-a-p (j-a-p) said :
#5

Thanks Ronaldo,

I'll give it a go.

Revision history for this message
j-a-p (j-a-p) said :
#6

Worked fine.

No I'll add the repos to the /etc/apt/sources.list.

Thanks people.

Revision history for this message
Vara Prasad (samvara007) said :
#7

sudo /usr/bin/debmirror --nosource -m --passive --host=in.archive.ubuntu.com --root=ubuntu/ --method=rsync -r :ubuntu --progress --dist=edgy --section=main,multiverse,universe,restricted --arch=i386 ubuntu/ --ignore-release-gpg
Password:
Mirroring to ubuntu/ from rsync://<email address hidden>/:ubuntu/
Arches: i386,i386
Dists: sid,edgy
Sections: main,main/debian-installer,contrib,non-free,main,multiverse,universe,restricted
Passive mode on.
Checking md5sums.
Will clean up AFTER mirroring.
Download at most 200 files per rsync call.
Pdiff mode: use.
Attempting to get lock, this might take 2 minutes before it fails.
Use of uninitialized value in string ne at /usr/share/perl5/LockFile/Simple.pm line 545.
Use of uninitialized value in kill at /usr/share/perl5/LockFile/Simple.pm line 546.
Use of uninitialized value in string ne at /usr/share/perl5/LockFile/Simple.pm line 545.
Use of uninitialized value in kill at /usr/share/perl5/LockFile/Simple.pm line 546.

Revision history for this message
Vara Prasad (samvara007) said :
#8

Hi All,

After 80% of Mirroring http://in.archive.ubuntu.com my Net Disconnected, and again when i try this comand am getting the following error.

Any Idea's

Thanks in advance

sudo /usr/bin/debmirror --nosource -m --passive --host=in.archive.ubuntu.com --root=ubuntu/ --method=rsync -r :ubuntu --progress --dist=edgy --section=main,multiverse,universe,restricted --arch=i386 ubuntu/ --ignore-release-gpg
Password:
Mirroring to ubuntu/ from rsync://<email address hidden>/:ubuntu/
Arches: i386,i386
Dists: sid,edgy
Sections: main,main/debian-installer,contrib,non-free,main,multiverse,universe,restricted
Passive mode on.
Checking md5sums.
Will clean up AFTER mirroring.
Download at most 200 files per rsync call.
Pdiff mode: use.
Attempting to get lock, this might take 2 minutes before it fails.
Use of uninitialized value in string ne at /usr/share/perl5/LockFile/Simple.pm line 545.
Use of uninitialized value in kill at /usr/share/perl5/LockFile/Simple.pm line 546.
Use of uninitialized value in string ne at /usr/share/perl5/LockFile/Simple.pm line 545.
Use of uninitialized value in kill at /usr/share/perl5/LockFile/Simple.pm line 546.