[ubuntu-za] add repo

Miles msdomdonner at gmail.com
Wed Feb 15 18:24:34 UTC 2012


-----Original Message-----
From: Hannes Coetzee <scorpking at scorpking.za.org>
Reply-to: Ubuntu South African Local Community
<ubuntu-za at lists.ubuntu.com>
To: Ubuntu South African Local Community <ubuntu-za at lists.ubuntu.com>
Subject: Re: [ubuntu-za] add repo
Date: Wed, 15 Feb 2012 19:47:24 +0200
Mailer: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17)
Gecko/20110516 Thunderbird/3.1.10

On 15/02/2012 09:56, Miles wrote:
> Hi all, can someone please tell me how to add my external drives
> /media/storage/packsM (Which is a rsync of /var/cache/apt/archives) as
> the repo the my sudo apt-get update and synaptic and update manager will
> use as the repo to do updates and installations of packages from. will
> the path /media/storage/packsM work or must I have a separate partition
> on the external called /media/repositories. My pc can not do unity so I
> need to keep Maverick with all its packages and updates etc here in case
> of needing to do a clean install for whatever reason and also be able to
> install Maverick on other drives with out needing to go online to get
> updates. My son is going to get the whole repo for me on an uncapped
> line for me to copy to my external. Oh ya, and are all the security
> updates and other updates kept at the same online repo? And is there a
> difference between official downloaded repos and a backup of my
> apt-cache. Thanks in advance for the help.
> Miles
>
>
The easiest way is to copy the debs in /var/cache/apt/archives to the 
same place on the machine where you want to install updates on.

The next option is to get a copy of the mirror using apt-mirror and copy 
that to a disk. Once you have a copy of the mirror add the following in 
your sources.list file: deb 
file:/path_to_mirror/archive.ubuntu.com/ubuntu/ maverick main restricted 
universe multiverse .You might have more than one mirror available so 
add what is needed. To keep your mirror up to date from an external 
source just copy changed files with cp -ru /source-mirror/* 
/destination-mirror/ .That will only copy new files.

The third option is a little more difficult but might be what you are 
looking for. I saved all the packages I had to a local repo back when I 
still used Hardy. I've included the script I used below. Copy all the 
archives to the folder where you want your repo and cd into it, then run 
the script and it should sort everything out for you. Make a backup of 
your archives just in case. I hope this will be enough info to get you 
started.

Hannes

<-----------------------/usr/bin/update_repo.sh------------------------>
<-------------------------------------START-------------------------------------->

#!/bin/sh
apt-move -d maverick update
echo "Rebuilding Main Packages.."
apt-ftparchive packages pool/main/ | gzip -9c > 
dists/maverick/main/binary-i386/Packages.gz
echo "Rebuilding Restricted Packages.."
apt-ftparchive packages pool/restricted/ | gzip -9c > 
dists/maverick/restricted/binary-i386/Packages.gz
echo "Rebuilding Contrib Packages.."
apt-ftparchive packages pool/contrib/ | gzip -9c > 
dists/maverick/contrib/binary-i386/Packages.gz
echo "Rebuilding Non-free Packages.."
apt-ftparchive packages pool/non-free/ | gzip -9c > 
dists/maverick/non-free/binary-i386/Packages.gz
echo "Rebuilding Partner Packages.."
apt-ftparchive packages pool/partner/ | gzip -9c > 
dists/maverick/partner/binary-i386/Packages.gz
echo "Rebuilding Multiverse.."
apt-ftparchive packages pool/multiverse/ | gzip -9c > 
dists/maverick/multiverse/binary-i386/Packages.gz
#echo "Rebuilding Hardy Updates.."
#apt-ftparchive packages pool/maverick-updates/ | gzip -9c > 
dists/maverick/maverick-updates/binary-i386/Packages.gz
echo "Creating release file.."
rm dists/maverick/Release
apt-ftparchive -c myapt.conf release dists/maverick/ > Release
mv Release dists/maverick/

#Add this line to /etc/apt/sources.list
#deb file:/ubuntu/ maverick contrib main multiverse non-free restricted 
partner maverick-updates

#gpg -bao dists/maverick/Release.gpg dists/maverick/Release



#mkdir .disk
#echo Ubuntu-Updates `date +%Y-%m-%d` > .disk/info
#gpg --export -a "Your Name" > public.key
#mkisofs -r -A "Ubuntu Updates `date +%Y%m%d`" -o ubuntu-updates.iso /ubuntu
#exit

echo "All done.."

<-------------------------------------END-------------------------------------->



Thank you very much Hannes,
I will try work my way through your advice and let you know if I was
successful. 




More information about the ubuntu-za mailing list