[ubuntu-za] add repo

Hannes Coetzee scorpking at scorpking.za.org
Wed Feb 15 17:47:24 UTC 2012

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 



apt-move -d maverick update
echo "Rebuilding Main Packages.."
apt-ftparchive packages pool/main/ | gzip -9c > 
echo "Rebuilding Restricted Packages.."
apt-ftparchive packages pool/restricted/ | gzip -9c > 
echo "Rebuilding Contrib Packages.."
apt-ftparchive packages pool/contrib/ | gzip -9c > 
echo "Rebuilding Non-free Packages.."
apt-ftparchive packages pool/non-free/ | gzip -9c > 
echo "Rebuilding Partner Packages.."
apt-ftparchive packages pool/partner/ | gzip -9c > 
echo "Rebuilding Multiverse.."
apt-ftparchive packages pool/multiverse/ | gzip -9c > 
#echo "Rebuilding Hardy Updates.."
#apt-ftparchive packages pool/maverick-updates/ | gzip -9c > 
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

echo "All done.."


More information about the ubuntu-za mailing list