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?
package-refresh-contents
? "Download descriptions of all configured ELPA packages. For each archive configured in the variable `package-archives', inform Emacs about the latest versions of all packages it offers, and make them available for download." Alternatively, use the graphical menuM-x package-list-packages
, which automatically refreshes the local package list. – Christromey.com
seems to be consulted. The variablepackage-archives
contains everything I want, and it's as if it's just not consulted. – Mayer Goldbergtromey
? I think it should saygnu
or justelpa
now… Did you try to installpackage.el
manually, or are you using the built-in version? Have you tried withemacs -Q
, which suppresses your config from being used? – Christromey.com:80
, and then displays a list of packages. It never shows any other hosts. I get your point about displaying the url rather than the key in the package-archives alist, but I don't know how and why it's not consulted. I'm using the builtinpackage.el
. – Mayer Goldbergemacs -Q
, then paste the snippet above into*scratch*
and evaluate it withM-x eval-buffer RET
. Then see if you get different results. – Chris