How do I extract an ISO on Linux without root access

Solution 1:

If 7zip is installed this one is really easy:

7z x Your.iso -oWhere/You/Want/It/Extracted/To

to extract the whole iso.

Solution 2:

Many of the GUI tools like file roller will use isoinfo in the background.

You can extract a single file from an ISO like so:

isoinfo -i image.iso -x /isolinux/initrd.img > initrd.img

The redirection is required as -x extracts to stdout.

If you'd like to list contents of a folder in the ISO:

isoinfo -i image.iso -l

example output:

Directory listing of /
d---------   0    0    0            2048      0 1900 [     26 02]  .
d---------   0    0    0            2048      0 1900 [     26 02]  ..
d---------   0    0    0            2048 Feb  6 2010 [     27 02]  i386
...

Solution 3:

I found a new best way: using xorriso!

No need to have root access. I've tried 7z and file-roller, both of them don't work here.

xorriso is an open-source program, so you can download the source codes if you don't have it installed by default.

If you haven't installed it, please download the source codes here: https://www.gnu.org/software/xorriso/

The steps are:

tar zxvf xorriso-1.4.6.tar.gz
cd xorriso-1.4.6
./configure
make
cd xorriso
pwd

Add the output directory into environment variable PATH.


Then, you can use it to extract an iso file:

xorriso -osirrox on -indev image.iso -extract / extracted_path

You just need to modify image.iso and extracted_path to make it work on your system.


Referred: https://blog.sleeplessbeastie.eu/2014/08/26/how-to-extract-an-iso-image/