Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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.. – marc-andre benoit Nov 27 '12 at 2:41
up vote 5 down vote accepted

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.
share|improve this answer
err, do you know if cdromupgrade will be available in the future ? – HackToHell Dec 1 '12 at 12:52
  • 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.

share|improve this answer
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.. – marc-andre benoit Nov 27 '12 at 3:22
I don't see any debs in my unsquashed filesystem – mfisch Nov 27 '12 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 ? – marc-andre benoit Dec 2 '12 at 17:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.