1

I'm having a lot of trouble getting up and running Ubuntu Server. I just installed it on VMware and it appears it doesn't have nano. When I run sudo nano /etc/hosts it says "-bash nano: command not found" and when I try sudo apt-get install nano it says

Media change: please insert the disc labelled 'Ubuntu Server 14.04.2 LTS Trusty Tahr - release amd64 in the drive '/media/cdrom/` and press enter

This is a fresh install so if I messed something up with it I'd rather start again. I thought nano came with Ubuntu, did I select something wrong?

Celeritas
  • 113
  • 2
  • 2
  • 7
  • “media change: please insert the disc labeled” when trying to install Ruby on Rails [duplicate] http://askubuntu.com/questions/386265/media-change-please-insert-the-disc-labeled-when-trying-to-install-ruby-on-ra – Aravinda Apr 04 '15 at 09:05
  • Does nano run **without** sudo? if yes, it could indicate that your sudoers `secure_path` is messed up. – steeldriver Apr 04 '15 at 11:04

3 Answers3

2

I'm out on a limb here, but it is probably simply a matter of 1. nano not being installed and 2. misconfigured package sources.

You can try the following:

  1. Comment the cdrom-related line in /etc/apt/sources.list by adding a # in front of it, like

# deb cdrom:[Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2)]/ trusty main

  1. Make sure you do have a Trusty repository in your /etc/apt/sources.list, e.g.

deb http://somemirror.ubuntu.com/ubuntu/ trusty main

deb-src http://somemirror.ubuntu.com/ubuntu/ trusty main

deb http://somemirror.ubuntu.com/ubuntu/ trusty-updates main

deb-src http://somemirror.ubuntu.com/ubuntu/ trusty-updates main

  1. sudo apt-get update

  2. sudo apt-get install nano

(Of course for this to work you'll have to rely on some other editor, I'm guessing vi or if you don't even have vi resort to some creative cat'ting and piping).

Tobia Tesan
  • 486
  • 2
  • 15
  • For `deb` and `deb-src` it says command not found – Celeritas Apr 06 '15 at 00:43
  • @Celeritas, those are not commands, you have to make sure you have those lines or something to that effect in your `/etc/apt/sources.list` file. Note that you have to replace `somemirror` with, well, some mirror - see https://wiki.ubuntu.com/Mirrors. If you are not sure copy your `sources.list` file to a USB drive and post it here. – Tobia Tesan Apr 06 '15 at 08:39
0

It must have some how been missed when installing the OS initially. I tried re installing and it worked fine.

Celeritas
  • 113
  • 2
  • 2
  • 7
-1

The problem seems to be the line relating to cdrom in your sources.list file. You can delete this line completely with

sudo sed -i '/cdrom/d' /etc/apt/sources.list

But perhaps it would be better (editor speaking here) to comment out the line to avoid too much destruction and make a backup in case you need it

sudo sed -i.bak '/cdrom/ s/^/#/' /etc/apt/sources.list
Zanna
  • 69,223
  • 56
  • 216
  • 327
RpR
  • 136
  • 4