I have used a few steps to keep my org-mode updated from elpa. However, it does not seem to work on the newly released org mode 9.5. With Emacs 27.1 under Ubuntu 20.04, the latest org mode I could ever get to is:
Org mode version 9.4.6 (9.4.6-798-g738759.dirty-elpaplus @ /.../.emacs.d/elpa/org-plus-contrib-20210929/)
My steps are:
First, in .emacs.d
rm -rf elpa/
to get rid of all old elpa packages. It's a bit extreme but I want to avoid the mixed install issue. After installing org mode, I will install all other Emacs packages.
Then, I used a one-liner command:
emacs -Q -batch -eval "(progn (require 'package) (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) (package-initialize) (package-refresh-contents) (setq package-load-list '(all)) (package-install 'org) (package-install 'org-plus-contrib))"
I don't know much about elisp and managed to assemble the above based on asking questions here. It has worked for quite some time. But as said earlier, it stopped upgrading org to the latest version from elpa. And I am also getting warnings like this:
IMPORTANT: please install Org from GNU ELPA as Org ELPA will close before Org 9.6
My question is:
How can I change the above script to make org upgrade to the latest 9.5 (and 9.6) elpa versions?
Related:
How to install latest version of org mode?
-- Update --
I removed init.el and then tried suggested command:
$ emacs -Q -batch -eval "(progn (require 'package) (package-initialize) (package-refresh-contents) (setq package-load-list '(all)) (package-install 'org))"
Importing package-keyring.gpg...
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:443
Package refresh done
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
‘org’ is already installed
then M-x org-version
reports:
command-execute: Cannot open load file: No such file or directory, org