Reputation: 1438
I need to add various packages to my emacs installation. It comes with tromey as the only repository. The variable package-archives is not defined (!). I am running GNU Emacs version 24.3.1 on Linux. I set up the following code in my .emacs
file:
(when (>= emacs-major-version 24) (require 'package) (setq package-enable-at-startup nil) (setq package-archives '()) (package-initialize) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/")) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) (add-to-list 'package-archives '("tromey" . "http://tromey.com/elpa/") t) )
By default, without this code, the variable package-archives isn't defined. After running this code, it is, and contains the right values, but doesn't seem to have any effect. I verified that this variable is not customized anywhere.
The problem is that I don't get to see any packages from the various archives I added; Only from tromey. Obviously I'm doing something wrong, but this code is supposed to work from emacs version 24 and higher.
Can someone suggest how to set up my repositories properly?
Upvotes: 2
Views: 7527
Reputation: 136910
Everything worked well! What does that mean? That something in my
.emacs
file is conflicting with elpa?
That's exactly what it means.
Comment out half of your configuration (comment-dwim
, bound to C-;
by default, might be helpful here) and see if that fixes it. That will tell you which have contains the ELPA conflict. Repeat with the half that shows the problem to find which quarter is problematic, then again to find the eighth…
Pretty soon you'll find the cause, which might be a single sexp. Remove or adjust that, uncomment the rest of your config, and enjoy the plethora of packages that await.
Upvotes: 0