Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have all images of Debian, Ubuntu and Ubuntustudio as .iso. How can I use them as repository to install my desired packages with sudo apt-get install package-name?

I easily mount the .iso file with Archive Mounter, but when adding CD-ROM in Software Sources it says Please Insert CD-ROM.

How should I do this without burning them to disk?

share|improve this question
    
possible duplicate of ubuntu.stackexchange.com/questions/3576/… –  dv3500ea Sep 24 '10 at 13:32
    
I accidentally deleted the original 'possible duplicate' comment that appeared when I voted to close the question (oops) - so I posted a new one. I'm not entirely sure whether the two questions count as duplicates because the questions are different but one question has been answered in the other question. –  dv3500ea Sep 24 '10 at 13:39
add comment

8 Answers

The above steps didn't worked for me. Anyways I happened to work it out with the help of debian user list and it worked.

Here are the steps.

1) Assume you have the iso file in /home/iso-files/ folder. I had the debian-7.1.0-amd64-DVD-1.iso in /home/iso-files folder

2) Make a new folder in /media

mkdir /media/dvd1-mountpoint

you will have to run the above command as root

3) Run the following command as root

mount /home/*yourUsername*/iso-files/debian-7.1.0-amd64-DVD-1.iso /media/dvd1-mountpoint -o loop 

4) Add an entry to /etc/fstab as follows

/home/*yourUsername*/iso-files/debian-7.1.0-amd64-DVD-1.iso /media/dvd1-mountpoint iso9660 loop,ro,user,noauto 0        0

5) Make an entry in your /etc/apt/sources.list as follows

deb file:/media/dvd1-mountpoint/ wheezy main contrib

6) Comment out everything else in /etc/apt/sources.list by adding a # at the start of every entry. only the above line should be uncommented.

7) Run the following command as root

apt-get update

8) Install any package name and now it should work.

apt-get install somePackage

9) You can check if your entry in fstab is correct or not by unmounting the dvd and then directly mounting the mountpoint

umount /media/dvd1-mountpoint
mount /meida/dvd1-mountpoint

10) If you plan to automount the dvd at start up you should remove user,noauto from entry in /etc/fstab

The above steps are working just perfectly for me. It should work for you also! I know I am pretty late to answer you, but anyways!

share|improve this answer
add comment
sudo mkdir /aptoncd-mountpoint

sudo mount /media/USB/aptoncd.iso ~/aptoncd-mountpoint -oloop

sudo apt-cdrom -d=/aptoncd-mountpoint add

On Raring, you should have problems: On my computer, apt-cdrom apparently umount the .iso. I solve this mounting again in another terminal window and hit while apt-mount answer me about ISO Mountpoint.

share|improve this answer
add comment

You could try the perl script given at following blog (Mounting Debian ISO files as Offline Software Repository):
http://miteshjlinuxtips.wordpress.com/2013/11/07/mounting-debian-iso-files-as-offline-software-repository/

Regards,
Mitesh

share|improve this answer
add comment
sudo mount  ~/Desktop/ubuntu-12.04.3-desktop-i386.iso /media/apt
sudo apt-cdrom -d=/media/apt add

This works.

share|improve this answer
add comment

Try this

mkdir /media/mountpoint  
mount -t iso9660 -o loop /pathtoiso.iso /media/mountpoint  

then add deb file:///media/mountpoint distro main contrib to /etc/sources.list with text editor and not with some GUI tool, then update from package manager.

share|improve this answer
add comment

I method described by dv3500ea does not working now. (I think it worked in past). It displays a message like:

    W: Failed to mount '/dev/sr0' to '/media/apt/'
    E: Unable to locate any package files, perhaps this is not a Debian Disc or the wrong architecture?

I fount this workaround useful:

After doing dv3500ea's method's first two steps, (I write this again for user's convenience)

sudo mkdir /aptoncd-mountpoint
sudo mount /media/USB/aptoncd.iso /aptoncd-mountpoint -o loop

you should run this:

sudo ln -s /aptoncd-mountpoint /media/apt

If it gives you error, saying /media/apt does not exists, create one with this

sudo mkdir /media/apt

Then run the third command of dv5300ea's command(slightly changed):

sudo apt-cdrom add

This should perfectly work.

share|improve this answer
add comment

I found the answer here: http://ubuntuguide.net/4-ways-to-upgrade-to-ubuntu-11-04-natty-narwhalonlineoffline (number 4).

Essentially, what it suggests is mounting the ISO as a CDROM. This probably fools the system into believing the ISO image is a real CD.

sudo mount -t iso9660 -o loop PATH/TO/ISO /cdrom

(I'm using this method to upgrade from 11.10 to 12.04 Alpha2, because it won't fit on a CD and for some reason my system isn't happy with USB drives.)

share|improve this answer
add comment

This question has already been answered as part of an answer to a different question: http://ubuntu.stackexchange.com/questions/3576/how-to-make-usb-drive-as-local-repository

The easiest way to add the image as a software source is to burn it to a CD/DVD. You then need to go to System -> Administration -> Software Sources, click 'Other Software' and click 'Add CD-ROM...'.

If you want to use the ISO image as a software source without burning it, the process will be a bit more complicated. You will need to open a terminal Applications -> Accessories -> Terminal and run these commands:

sudo mkdir /aptoncd-mountpoint

sudo mount /media/USB/aptoncd.iso ~/aptoncd-mountpoint -oloop

sudo apt-cdrom -d=/aptoncd-mountpoint add

(source: http://www.debianhelp.org/node/10486)

share|improve this answer
    
But this method is not working anymore. I tried this with xubuntu-11.10-alternate-iso, and it says Failed to mount '/dev/sr0' to '/media/apt/' and Unable to locate any package files, perhaps this is not a Debian Disc or the wrong architecture? . –  Anwar Shah May 11 '12 at 8:26
    
I think the second command is sudo mount /media/USB/aptoncd.iso /aptoncd-mountpoint -oloop without ~ before /aptoncd-mountpoint –  Anwar Shah May 11 '12 at 8:39
    
Still not working! –  BigSack Aug 11 '12 at 15:15
add comment

Your Answer

 
discard

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.