Created
June 29, 2025 14:53
-
-
Save mlabbe/ca84d1711d5349c3a4067d85e6484a61 to your computer and use it in GitHub Desktop.
Update Emacs packages on the command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
emacs --batch -l ~/.emacs \ | |
--eval="(progn (require 'package) \ | |
(package-initialize) \ | |
(package-refresh-contents) \ | |
(mapc (lambda (pkg) | |
(let* ((new (cadr (assq pkg package-archive-contents))) | |
(installed (cadr (assq pkg package-alist)))) | |
(when (and new installed | |
(version-list-< (package-desc-version installed) | |
(package-desc-version new))) | |
(package-install new)))) | |
(mapcar 'car package-alist)))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment