- 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:
Monday, April 18, 2011
Use OpenSSL to sign a document
OpenSSL is an open source cryptography library with lots of useful functions. First part, how to sign a document using DSA signature scheme.
Links:
- Use dsaparam to generate DSA parameters(p, q, g), used to generate keys (possibly several keys):
openssl dsaparam 1024 > dsaparam.pem
- Generate key file (contains private and public key):
openssl gendsa dsaparam.pem -out dsa_key.pem
Or, if the parameters p,q,g weren't precomputed (step 1):
openssl dsaparam -noout -out dsa_key.pem -genkey 1024
- Extract public key
openssl.exe dsa -in dsa_key.pem -pubout -out dsa_pub_key.pem
- Generate sha1 hash of a file.
openssl dgst -sha1 foo.txt | awk '{print $2}' > foo.txt.sha1
- Sign the hash
openssl dgst -dss1 -sign dsa_key.pem text.txt.sha1 >foo.txt.sig
- Verify the signature (using public key)
openssl dgst -dss1 -verify dsa_pub_key.pem -signature foo.txt.sig foo.txt.sha1
Links:
Subscribe to:
Posts (Atom)