I am trying to install package auto-complete. But when I typed M-x package-install [ret], then emacs showed "contacting host: elpa.gnu.org:80". After a while, it showed "Install package". Then I typed "auto-complete", it prompted "no match". Do I miss something here? thanks.
The following has been tested to work on an
emacs -Q session:
- Add the below in the scratch buffer:
(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
- Evaluate the buffer (
M-x package-install RET auto-complete RET
The package will install.
Note that step 4 will NOT work if you already have the package installed in the
~/.emacs.d/elpa/ folder. So to test this, either move the
elpa/ folder to something like
elpa.bkp/ before step 1 or do
M-x list-packages (after step 3), find the
auto-complete package in there, hit
d to mark it for deletion and then
x to execute the deletion. Then step 4 will work once again.
You must add the urls for gnu, melpa, marmalade repositories in .emacs file
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("melpa" . "http://melpa.org/packages/")))
After doing this, run
M-x package-refresh-contents and
M-x auto-complete. It should work.