1

Like many others, I encountered problems with org mode 9.6, except in my case, org mode only works with 9.6. I get errors if trying to use version 9.5.5 (e.g. trying to export a file to pdf: Symbol’s function definition is void: org-assert-version).

However, I've had no luck with fixes posted (details on my failures below):

My issue:

  • if I delete the Org-9.6 directory in my Elpa repository
rm -rf ~/.emacs.d/elpa/28.2/develop/org*
  • and then boot emacs:
/snap/emacs/current/usr/bin/emacs &

Everything works fine. The org package is found missing, it is automatically reinstalled and M-x org-version returns Org mode version 9.6.4 ( @ /home/HB/.emacs.d/elpa/28.2/develop/org-9.6.4/) as desired.

  • but then if I re-start emacs (with or without -Q or -q flags), M-x org-version now returns Org mode version 9.5.5 (release_9.5.5 @ /home/HB/.emacs.d/elpa/28.2/develop/org-9.6.4/). So, even though the correct path is listed, an older version of org-mode has been loaded.

I attempted this fix and this fix. No obvious errors but the problem persists.

I attempted this fix but the inclusion of

(setq custom-org-path "~/.emacs.d/elpa/28.2/develop/org-9.6.4")   
  (add-to-list 'load-path custom-org-path)

in my init.el did not fix the problem, and the inclusion of

(require 'cl)
   ;; Org-mode that was shipped with Emacs
  (setq load-path (remove-if (lambda (x) (string-match-p "org$" x)) load-path))
  ;; ELPA 
  (setq load-path (remove-if (lambda (x) (string-match-p "org-20" x)) load-path))

introduced a major error that prevented emacs from opening. I had to use vim to open the file and undo.

Likewise, when I tried this fix the inclusion of (package-initialize) in my init.el also prevented emacs from opening at all.

I have uninstalled and reinstalled emacs (both version 28.2 via snap, and version 27.1 via apt) and encountered the same issue with both versions.

My current workaround is to launch emacs via a shell script:

#!/bin/bash

rm -rf ~/.emacs.d/elpa/28.2/develop/org*

/snap/emacs/current/usr/bin/emacs &

This suffices to get work done for now, but I would appreciate any advice for a more elegant solution.

Details:

  • GNU Emacs 28.2 (also replicated with 27.1)
  • Ubuntu 22.04.2

When I ran C-h f org-version and clicked on org.el the file is in /snap/emacs/current/usr/share/emacs/28.2/lisp/org, which is not what I expected, but it always shows the same, even after a fresh org install when everything is working.

2
  • 1
    Instead of updating the question with a fix, you should instead add an Answer. You should do this even if it isn’t the best answer, since it doesn’t prevent someone else from adding a better one later.
    – db48x
    Apr 28, 2023 at 1:52
  • 1
    Done. Thanks for the suggestion.
    – HB.
    Apr 28, 2023 at 15:25

1 Answer 1

2

Answer to my own question here:

If anyone else encounters something similar, I finally fixed this with a sledgehammer approach:

  • I uninstalled every version of emacs on my system of which I could find any trace. (sudo apt-get remove emacs emacs23 emacs24 emacs25 emacs26 emacs-bin-common emacs-common emacs-el emacs-gtk and I searched for any source files, found one, unpacked it and ran make uninstall )

  • I then did a fresh clean install of emacs30 (sudo snap install emacs --edge --classic)

And org-mode functionality is now restored. I'm not sure if the solution was clearing out the old versions or updating from version 28 to 30 but it must have been one of the two.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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