7

I am getting this error:

sudo apt-get install emacs23
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package emacs23

Moreover, I ran:

sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I have the latest public release version 12.10 Quantal Quetzal of Ubuntu.

3
  • Please don't say "newest", as this can change over time. The newest LTS release is 12.04 Precise Pangolin(which I use.) The latest Public release is 12.10 Quantal Quetzal. The latest latest release (as of time of writing) is the 13.04 Raring Ringtal beta. So please edit the proper version into your question. (there is an edit link right above this comment, just to the right of "share".) Apr 6, 2013 at 5:31
  • 1
    i have edited the reply . sorry for that slip
    – aditya
    Apr 6, 2013 at 5:38
  • Hey, if I fixed it, I would appreciate it a lot if you'd click the green checkmark to the left of my answer. This marks your problem as solved, which makes it easier for new users to get help with their Ubuntu issues, also I get some Reputation as a reward for being so helpful (also, you get a little reputation ;) Apr 22, 2013 at 21:48

2 Answers 2

9

You need to update your package lists.

Run:

sudo apt-get update

Then try again. That will fix everything.

You see, when Ubuntu software developers write their software, they send it to the Launchpad servers, where they compile and process the code. Once the code has been successfully compiled, the new package replaces the old package, and the package lists are updated to reflect that change.

Note that it's just the package lists on their server, not your computer. sudo apt-get update fetches the latest package info from the servers, at which point your computer processes it.
The command sudo apt-get upgrade checks the package lists (the ones stored on your computer) and compares the software in the package list with the actual versions you have installed. If any of your software has a version newer than it listed in the package list, it will download and install it.

Running sudo apt-get install <PACKAGE> checks your package list for that software. If found, it downloads and installs it.
(note that the package lists do not contain the software themselves - only the name, version, and the URL to download the software.)

Anyway, I hope my little speech helped you understand Ubuntu's package system a little better!

1
  • 1
    +1, Maby you should explain sudo apt-get dist-upgrade to then it is complete ;-)
    – Thomas15v
    Apr 6, 2013 at 7:44
0

run sudo apt-get update then try to install again.

If that does not work use the graphical software center and see what you get. emacs23 looks to be a valid package name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .