13

I installed Debian 7 using a USB flash drive "burned" from the first DVD ISO of the Debian installation CD/DVD.

I did a very minimal install without Debian desktop environment, Print server and Standard system utilities.

After installation and a reboot, I was presented with a console with the words Debian GNU/Linux 7 hostname tty1. I supplied the login username and password.

After I typed the command sudo apt-get install xorg, an error message popped up stating:

Media changed: please insert the disk labeled 'Debian GNU/Linux 7.4.0 _Wheezy_ - Official amd64 DVD Binary-1 20140208-13:47' in the drive and press Enter

I inserted the same USB flash drive into the same port and after waiting for a few seconds, I pressed Enter.

The same error message popped up.

I have tried the following steps on the advice of some of my colleagues:

  1. remove/delete all the entries in /etc/apt/sources.list and reboot the computer
  2. dmesg and fstab show that the USB thumb drive is mounted on /dev/sdb1
  3. sudo mount /dev/sdb1 /media/usb0
  4. sudo apt-cdrom -m -d /media/usb0 add

After doing the above, the following error message appears:

Using CD-ROM mount point /media/cdrom/
Identifying.......{a long string of alphanumeric characters}
Scanning disc for index files...............
Found 0 package indexes, 0 source indexes, 0 translation indexes and 0 signatures
W: Failed to mount '/dev/sr0' to '/media/cdrom/'
E: Unable to locate any package files, perhaps this is not a Debian disc or the wrong architecture

I prefer to install Xorg (60MB) and gnome-core (400MB) from the USB stick. The NGO that I am working with is in a developing country with a very basic internet access infrastructure. Internet access is very patchy and the average download speed is less than 2 Mbps.

  • 1
    The apt-cdrom output says it is looking at /media/cdrom, change the command to sudo apt-cdrom -m -d=/media/usb0 add – fooot Apr 23 '14 at 16:27
  • 1
    When you change /etc/apt/sources.list, there is no need to reboot, but you must run sudo apt-get update. I'm not familiar with apt-cdrom, but I would assume that requires the same update afterwards. Also, if your internet connection is unreliable / slow, you might want to remove / comment out any online sources from /etc/apt/sources.list once you can install from local media, just so you don't have to wait for the update to contact the servers listed. – ssc Apr 24 '14 at 6:12
1

I found that this problem was very similar to my own. Debian installed from USB stick but then when I try to use apt-get install I am prompted for a CdROM.
After much fuss I found part 14.3.1 of the Debian tutorial valuable because it explains the syntax for instructing the system to look for source content in a file location. Here's what i did:

I ensured the usb stick was mounted and I took note of its location in the filesystem. For me that was /media/Debian 7.5 64 Copyleft FM

As su I edited sources.list so that the line with "deb cdrom" was commented-out. Then I added a new first line of that file using the tutorial info and my usb stick file location:

deb file:/media/"Debian 7.5 64 Copyleft FM" wheezy contrib local main non-free
#deb cdrom:[Debian GNU/Linux 7.5 _Wheezy_ - Copyleft amd64 Full Monty amd64 DLBD Binary-1 20140427-09:14]/ wheezy contrib local main non-free

For newbies such as me, note the use of quotes in the URI to protect the enclosed spaces from being misunderstood. (See Nixcraft forum: Howto cd to folder name with spaces blank names (white space)

Then I ran sudo apt-get update as advised above (thx). That's all I did.

This solved my problem - I was able to run sudo apt-get install vim and I was no longer asked to insert a CD.

  • How did you mount your USB stick? – user65787 Jan 9 '15 at 1:52
  • 1
    @user65787 /media/something is probably an auto-mount, presumably owenmck was logged into a GUI session at the time. – Jasen Jun 9 at 7:21
-1

so in line with the previous answer, I just told my system to not even bother to use the cdrom as a source for updates at all.

I first had to change the file permissions of sources.list so I could change it

change to directory it was in

    cd /etc/apt

then change permissions

    chmod 666 sources.list

(read/write for owner, root, and user)

then I could open the file in text editor, and with new basic user read and write permissions, and stuck # in front of the line looking at the cdrom as a source.

    #deb file:/media/"Debian 7.5 64 Copyleft FM" wheezy contrib local main non-free

then changed permissions back to only owner and root could write as well as read, but user could not

    chmod 664 sources.list

apt-get now installs programs.

someone might tell me later there is a problem with this, but hey. it worked :)

  • 2
    The appropriate way to edit a file that you don't have write access to is to run the editor (i.e., vi, vim, emacs, pico, ed, teco, or whatever you use) under sudo, and not to chmod the file so it's world-writable and then chmod it back afterwards.  So, beyond that, I'm not clear what your answer is.  Are you saying that your /etc/apt/sources.list file already had a deb file:/media/... line in it?  And that, after commenting it out, apt-get now installs programs from the flash drive?  Are you sure it's not downloading from the Internet? – G-Man Jun 20 '15 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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