Using /var/cache/apt

Dake K. Odzangba odzangba at gmail.com
Mon Feb 9 13:30:05 UTC 2009


On Monday 09 February 2009 11:56:48 Robert Parker wrote:
> A friend is moving his Ubuntu install from a usb stick to a dedicated
> partition on his hard drive. He wants to avoiding downloading all of
> the updates into the new installation.
>
> How to reuse the packages in /var/archives/apt?
>
> He will naturally be making a backup copy of /var as well as /home
> before starting off.
>
> Thanks,
> Bob Parker
> --
> In a world without walls who needs Windows (or Gates)? Try Linux instead!

1. Make sure build-essential is installed (you only need dpkg-dev but...)
2. Copy the deb files in /var/cache/apt/archives to a folder of your choice
3. cd into that folder and do:
	sudo dpkg-scanpackages . /dev/null | gizp -9c > Packages.gz
4. On the new system, edit /etc/apt/sources.list and include something close 
to this:
	deb file:<backed_up_apt_folder>/ /
So if the downloaded deb packages are in /home/robert/repo, the line will look 
like
	deb file:/home/robert/repo/ /
5. Update the package index like so:
	sudo apttitude update
6 Remember to repeat #3 evrytime new debs are added to the repo folder

For more information, visit:
http://odzangba.wordpress.com/2006/10/13/how-to-build-local-apt-repositories/
-- 
Odzangba,
Blog: http://odzangba.wordpress.com
Registered Linux User #431909
Registered Linux Machines: #337242 #363374 #392526
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090209/54ef7276/attachment.html>


More information about the ubuntu-users mailing list