PREVENTS UNCONTROLLED UPSTREAM PACKAGE CHANGES PREVENTS NETWORK CONGESTION ISSUES PREVENTS INSTALLING ARBITRARY PACKAGES
PART 1, GET THE PACKAGES IN A CORRECT REPO FORMAT
sudo apt-get update sudo apt-get install apt-mirror
sudo vi /etc/apt/mirror.list # discover that the default space for mirroring is /var/spool/apt-mirror
comment out all of the ubuntu packages (not going to start by mirroring ubuntu), instead...
deb http://mirrors.supportex.net/mariadb/repo/5.5/ubuntu precise main # tab, not spaces
deb-amd64 http://mirrors.supportex.net/mariadb/repo/5.5/ubuntu precise main deb-i386 http://mirrors.supportex.net/mariadb/repo/5.5/ubuntu precise main
sudo apt-mirror
Downloading 169 index files using 20 threads...
Begin time: Tue Aug 20 15:13:26 2013
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Tue Aug 20 15:13:33 2013
Proceed indexes: [P]
117.8 MiB will be downloaded into archive.
Downloading 17 archive files using 17 threads...
Begin time: Tue Aug 20 15:13:33 2013
[17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Tue Aug 20 15:14:28 2013
0.0 bytes in 0 files and 0 directories can be freed.
Run /var/spool/apt-mirror/var/clean.sh for this purpose.
Running the Post Mirror script ...
(/var/spool/apt-mirror/var/postmirror.sh)
Post Mirror script has completed. See above output for any possible errors.
ls /var/spool/apt-mirror # should be something like mirrors.supportex.net
PART 2 INSTALL FROM LOCAL SOURCE
test by commenting out all parts of /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
sudo echo "deb file:///var/spool/apt-mirror/mirror/mirrors.supportex.net/mariadb/repo/5.5/ubuntu precise main" >> /etc/apt/sources.list.d/mariadb.list
PART 3, CREATE AN S3 BUCKET AND UPLOAD
Use AWS Web Console or s3cmd to create a bucket
After creating the bucket choose Static Website Hosting
http://mybucket.s3-website-us-east-1.amazonaws.com/index.html
use s3fox or s3cmd to upload the files (e.g. make folders mariadb/repo/5.5/ubuntu and put everything from a corrseponding point in /var/spool/apt-mirror there)
Mess around with bucket policies (ip address restrictions) and permissions (everyone read and list?)
PART 4 INSTALL FROM S3 BUCKET
assuming already commented out all parts of /etc/apt/sources.list
sudo echo "deb http://mybucket.s3-website-us-east-1.amazonaws.com/mariadb/repo/5.5/ubuntu precise main" > /etc/apt/sources.list.d/mariadb.list