Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new to Ubuntu and when I try to install emacs it shows error: I am running Ubuntu in virtual box.the error is shown below

talha@talha-Virtualbox::~$ sudo apt-get install emacs23
reading package lists ... done
building dependancy tree
reading state information ... done 
E:unable to locate package emacs23

how to correct the problem?

share|improve this question
Which version of Ubuntu are you using? – Florian Diesch Nov 27 '12 at 19:05

You need to run sudo apt-get update first. This command downloads the index of the repository (See What does "sudo apt-get update" do?). It should have been run automatically during installation, but if for some reason you weren't online, it might not have happened yet.

share|improve this answer

Your command means "find a package named emacs23 and install it".

E:unable to locate package emacs23

means that the system that is looking for the package (apt), cannot find it. There is no reference to this package.

This could mean several things

  1. the package does not exist: this is not the case for you, as this package does exist.
  2. the package does exist, but not in any source you are using. This could be the case, but isn't very likely: it is present in the basic sources you probably have. You could, if all else (meaning the next point) fails, try and check out what sources you are using.
  3. You didn't update your apt. For apt to know what it can do with current sources, it needs to know what packages are available. You do this by typing the apt-get update command (possibly using sudo, making it:

    sudo apt-get update

    now it knows what packages are available, and if you don't run in to problems 1 or 2, you'll be set to go.

share|improve this answer

Your Answer


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.