4

How can I extract the deb files of ubuntu 12.10 from the official iso, I am trying to cut the download time, only some packages are in /pool/main

The rest seem to be in a virtual fs in /casper/.

How can I extract the deb files?

1
  • does it need to be from a cd or an iso file specifically ? i ask because you could always wget a mirror site recursively grabbing only files with a .deb filetype instead.. Nov 27, 2012 at 2:41

2 Answers 2

5

Most of the debs Ubuntu uses are installed into a chroot before generating the ISO image, so you can't just get them back. If you unsquash the filesystem, you'll see it looks like just a root filesystem. For example, this is a truncated view of ls:

drwxr-xr-x   2 root root  4096 Oct 12 16:59 bin
drwxr-xr-x   3 root root  4096 Oct 12 16:59 boot
drwxr-xr-x   4 root root  4096 Oct 12 16:56 dev
drwxr-xr-x 134 root root 12288 Oct 12 16:59 etc
drwxr-xr-x   2 root root  4096 Oct  9 08:59 home

...

If you want to mess with the chroot, you can do so as follows:

  1. Mount the ISO

    sudo mount -o loop quantal-desktop-i386.iso tmpiso
    
  2. Copy the squashfs out

    cp tmpiso/q/casper/filesystem.squashfs /tmp
    
  3. Unsquash the filesystem

    sudo unsquashfs filesystem.squashfs
    
  4. This will unpack the filesystem into squashfs-root.

  5. Make your changes.
  6. Recompress with squashfs.
  7. Use ISO master to replace the filesystem.squashfs with the one you modified.
  8. Rebuild the ISO with ISO master.
1
  • err, do you know if cdromupgrade will be available in the future ?
    – HackToHell
    Dec 1, 2012 at 12:52
2
  • Mount the iso.
  • Copy squashfs and unsquash it.
  • in the extracted folder i'd execute this from the shell.

    find -name "*.deb" -type f -execdir cp {} ~/Desktop/thefolder_you_choose/ \;

    This finds all .deb files and dumps all of them (without the folder structure) in your destination folder.

3
  • doing a recursive wget only searching for deb files in a mirror brings back all deb files in a folder tree.. to which you can execute the same command if you want all the deb files in one spot.. Nov 27, 2012 at 3:22
  • I don't see any debs in my unsquashed filesystem
    – mfisch
    Nov 27, 2012 at 15:15
  • yes i agree me neither.. i just got a minute to test it all out.. and your best bet (if you want all the debs from the ubuntu and i mean all possible ones.. ) would be to wget all possible files from a ubuntu mirror.. but this option will leave you with all the files in a file tree ,then you run my commend to put them all in one unique folder.. if you don't mind me asking,why is it you want all the .deb files ? Dec 2, 2012 at 17:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .