I’ll assume you have an iso image named ubuntu-7.04-alternate.iso in your home folder (for convenience). If you do not have the iso but have the ubuntu cd, you can create an image like this:
cd to the directory you want the iso in, e.g.:
cd ~
then:
sudo dd if=/dev/cdrom of=ubuntu-7.04-alternate.iso
* If you already have the ubuntu image, then let’s create the mount point (folder). Open a terminal and do this:
sudo mkdir /media/ubuntu-7.04-alternate
* We want to mount the image automatically when the computer starts. Edit the fstab file like this:
gksudo gedit /etc/fstab
You can use your favorite editor here… users of kubuntu may replace ‘gedit’ with ‘kate’
* Append the following line to the file you’ve just opened
/home/$username/ubuntu-7.04-alternate.iso /media/ubuntu-7.04-alternate iso9660 ro,loop,auto 0 0
Remember to replace $username with your username
* Save the file and exit.
* Type the following command to mount the image:
sudo mount -a
* Type in the following command to edit your apt sources list file:
gksudo gedit /etc/apt/sources.list
* Add the following line to the file:
deb file:/media/ubuntu-7.04-alternate/ feisty main restricted
This will work for a feisty fawn image. Replace feisty with the appropriate version of ubuntu you are working with… dapper, edgy, hoary, et cetera.
* Save and close the file
* Update your package index like this:
gksudo apt-get update
* That’s it…
Cheers,
Odzangba.


Thank you very much for these clear and concise instructions
I would maybe add a small beginning section showing how to create an .iso from the bootable alt install cd. in my situation, I wanted to pass the cd along to a friend, so I just copied the .iso
I was able to find instructions on how to do it.
cd to the directory you want the iso in, e.g.:
cd ~/images/
then:
sudo dd if=/dev/cdrom of=ubuntu-6.06-alternate
that is just my two cents, I guess its not that common, but it can help.
By: Tim on February 12, 2007
at 9:26 pm
Thanks for the tip Tim, I’ll add it to the how-to and you’re right… it can help. I’m glad you found this little piece useful.
Cheers,
Odzangba
By: odzangba on February 14, 2007
at 5:23 pm
Thank you very much for this very clearly written tip. Followed instructions and it works flawlessly.
By: steffan on November 24, 2007
at 4:16 pm
sudo apt-cdrom add -d /media/ubuntu-7.04-alternate/
… adds and authenticates gpg keys and alleviates the need to…
sudo vi /etc/apt/sources.list
By: josh fuller on June 9, 2008
at 6:01 pm
Well nice article brother
Excellent topic..
I too wrote same topic. But your article is much better than mine:)
http://elechub.com/how-to-create-iso-image-file/tip/
By: abdul on June 16, 2008
at 8:07 am
I’ve been looking for a way to do this with multiple ISOs. At work we have a load of servers without Intenet access. I want to simply download all the install ISOs and any update ISOs and use those for installs and upgrades.
I’m attempting to solve this by mounting the ISOs and serving them up via HTTP, but so far I haven’t got it to work.
By: Andrew Sussex on July 1, 2008
at 10:02 am
I just saw your post “Use Apt-mirror to Create Your Own Ubuntu Mirror” and noticed the file:/ URI. I replaced my http:// URIs with these and it works!
Summary:
(1) Mount your ISO images using loopback.
eg:
# mount debian4.0r2.dvd1 /mnt/apt/dvd1
# mount debian4.0r2.dvd2 /mnt/apt/dvd2
# mount debian4.0r2.dvd3 /mnt/apt/dvd3
# mount debian-update-4.0r2.dvd /mnt/apt/update1
# mount debian-update-4.0r3.dvd /mnt/apt/update1
(2) Add mountpoints to /etc/fstab so they persist across reboots.
(3) Add file:/ URIs to /etc/apt/sources.list.
eg:
deb file:/mnt/apt/dvd1 etch contrib main
deb file:/mnt/apt/dvd2 etch main
deb file:/mnt/apt/dvd3 etch main
deb file:/mnt/apt/update1 etch contrib main non-free
deb file:/mnt/apt/update2 etch contrib main non-free
(4) apt-get update
Works for me.
By: Andrew Sussex on July 1, 2008
at 10:15 am
I’m glad for you, Andrew.
By: odzangba on July 1, 2008
at 10:24 am
http://ubuntuforums.org/showthread.php?p=5823128#post5823128
I came over from above old post where I got everything mounted and the loop back setup, but the sources.list entry wasn’t working, had to add the version as see here. Thanks!
And that Josh Fuller tip is awesome. I ended up adding all the ISO’s that way. Very nice.
Thanks all!
By: William Smart on September 20, 2008
at 7:49 am
Thanks for the kudos. I usually use that trick to keep an iso for ubuntu server loop-mounted on the servers I admin at work. No point in downloading things you don’t have to, right?
By: Josh Fuller on July 13, 2009
at 5:11 pm