I'm using use-package to install and configure packages (most of these packages are in melpa). Is there a clean automated way of keeping all these packages up-to-date ?

If not, what is the best work flow in this case ?

Note: A very similar question here with an answer, but I wanted a clarification on "You'll still need to deal with installing updates". I could not comment on the answer for clarification as I do not have enough reputation.


I just do this manually: run list-packages hit Uto mark available upgrades, then review to decide if there are any I don't want to pick up. Then x to upgrade. I do this pretty regularly, and often check what's new at the same time. I've got a couple tweaks to simplify this (see below).

I suspect upgrading could be automated, but you do want to consider the case where an update breaks something and you need to back it out and then prevent your automated updater from just installing it again.

Some package menu tweaks:

(defun package-menu-find-marks ()
  "Find packages marked for action in *Packages*."
  (occur "^[A-Z]"))

;; Only in Emacs 25.1+
(defun package-menu-filter-by-status (status)
  "Filter the *Packages* buffer by status."
   (list (completing-read
          "Status: " '("new" "installed" "dependency" "obsolete"))))
  (package-menu-filter (concat "status:" status)))

(define-key package-menu-mode-map "s" #'package-menu-filter-by-status)
(define-key package-menu-mode-map "a" #'package-menu-find-marks)

With this I can use s new to just see what packages are newly available. And after hitting U to mark upgrades I can hit a for an occur buffer list of the ones that were marked, in case I want to dig in to details of what changed etc.

  • Thanks, the questions is primarily answered. a worked for finding out marked packages. However, s installed or any of the other remaining three statuses returns an empty list. – Jaagrit Sapana Apr 2 '17 at 14:05
  • What version of Emacs are you using? – glucas Apr 2 '17 at 15:03
  • I'm using 24.5.1 – Jaagrit Sapana Apr 2 '17 at 22:58
  • Ah ok. I checked and the package-menu-filter command is new in 25.1, so that command won't work for you. – glucas Apr 3 '17 at 0:20
  • I do this every Monday morning – Ricky Nelson Mar 8 '19 at 0:52

You can use auto-package-update to automatically update packages.

Copied from my other post (https://emacs.stackexchange.com/a/31903/9972)

(use-package auto-package-update
   :ensure t
   (setq auto-package-update-delete-old-versions t
         auto-package-update-interval 4)

With that setup, packages will be updated every 4 days, and the old packages will be removed.

  • Doesn't Emacs require to be restarted after a packages update (at least for some packages)? – Denis Bitouzé Dec 4 '20 at 9:00
  • 1
    True, but if you put this peace of code before the other packages get loaded, you should be fine. – cslux Jan 17 at 17:12

There is a highly recommended package called paradox that extends package management commands. Read more from https://github.com/Malabarba/paradox

(use-package paradox
  (setq paradox-github-token t)
  (setq paradox-execute-asynchronously t)
  (setq paradox-automatically-star t))

This setup feeds package usage statistics back to system using a separately set github token and updates packages in the background when you manually run the command paradox-upgrade-packages bound to your keys of choice.

Read the inline documentation of the variable paradox-github-token on how to set it up.


Try epm to keep update process clean.

cf. https://github.com/xuchunyang/epm

It can run update process within emacs batch process, without loading normal init.el settings.


Just enter list-packages and pres SHIFT+U. It will mark all installed packages for an update.

  • 1
    It's arguably not fully automatic. – JeanPierre Sep 29 '19 at 7:27

Emacs package update sometimes fails.

If package installation is automated using use-package, delete the .emacs.d/elpa directory and reinstall the package.

good luck

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.