- Install the application on a computer with internet:
$ sudo apt-get install debmirror
- Get the key for the repository and add it to the keyring. This can be done be importing it from a debian keyring:
$ gpg --no-default-keyring --keyring /home/USER/.gnupg/trustedkeys.gpg --import /usr/share/keyrings/ubuntu-archive-keyring.gpg
- Download the repository (approximate sizes for different repositories can be found in the man page):
$ sudo debmirror -a i386 --no-source -s main -h ro.archive.ubuntu.com -d natty,natty-updates,natty-security -r /ubuntu --progress -e http mirror
This mirrors section main of Ubuntu 11.04 Natty, updates and security. All options are explained in the man page.
- Mount usb device containing the repository to the other computer:
$ mount /dev/sdb1 /mnt/usb
- Create a backup copy of sources.list file and modify it:
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup $ sudo vim /etc/apt/sources.list
Delete all content and add just:
deb file:///mnt/usb/mirror natty main deb file:///mnt/usb/mirror natty-updates main deb file:///mnt/usb/mirror natty-security main
- Retrieve the new list of packages from the offline repository:
$ sudo apt-get update
- Upgrade the repository:
$ sudo apt-get upgrade
- Start installing packages....
Saturday, April 30, 2011
How to create an offline Ubuntu repository
Debmirror program creates a local mirror of a Deban repository. A quick way to build an offline repository, save it to to an USB drive, and use it on a computer without internet access:
Labels:
offline,
repository,
ubuntu
Subscribe to:
Post Comments (Atom)
Very useful, thank you.
ReplyDelete