I'm trying to figure out a way to speed up my spacemacs start time. The main offender at the moment is the refreshing of package archives at start. I was hoping that setting dotspacemacs-check-for-updates would achieve this, but alas, this has no effect on the packages (which actually makes sense to me).

Internet searches haven't really helped; maybe I've not searched the right words. Digging into the source code, I saw that if I globally set configuration-layer--package-archives-refreshed to a non-nil value, I can short-circuit the function configuration-layer/retrieve-package-archives to suppress this functionality.

This of course a dirty hack. Can someone tell me if there is some officially supported way of doing this and how?


as far as I know, switching git branches from develop to stable (or mainor release –– sorry, forgot the exact name) is the best solution to this; at least, the spacemacs documentation states that the develop branch always updates while stable does recognize the variable in the config file.


There doesn't appear to be an "official way" and the issue was closed.

A solution (inspired by the idea in the OP's question) that works in the devel branch (and maybe in others) is to add the following lines to inside the body of the function dotspacemacs/init in ~/.spacemacs:

  (getenv "spacemacs_do_not_refresh_packages")

It's then possible to launch emacs as follows to avoid package refresh:

spacemacs_do_not_refresh_packages=t emacs

For example, I can export myfile.org to html from the command line without waiting for package refresh as follows:

spacemacs_do_not_refresh_packages=t emacs \
  --batch \
  --script ~/.emacs.d/init.el \
  --file myfile.org \
  --funcall org-html-export-to-html \

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.