I had this code in my emacs config to load/include any additional config in the site-start.d folder. It worked well on two debian machines, but currently I need to use Ubuntu 18 with emacs 26.3 and it fails.

(setq dotfiles-dir (file-name-directory (or load-file-name (buffer-file-name))))          
(let ((user-site-start-dir (concat dotfiles-dir "/site-start.d")))                        
     (debian-run-directories user-site-start-dir))

From a related answer at https://stackoverflow.com/a/27676611 I understood it is both available in debian and Ubuntu. The error I get on start is:

Warning (initialization): An error occurred while loading ‘/home/foo/.emacs.d/init.el’:

Symbol's function definition is void: debian-run-directories

What is the easiest way to use it in Ubuntu?


Ubuntu 18.04 does not have emacs 26 in its repositories, so it has been installed from source or from a ppa that doesn't include the debian patches.

The function debian-run-directories is defined in debian-startup.el that is part of the emacsen-common package, you can install it with

sudo apt install emacsen-common

After the package installation you may need to add /usr/share/emacs/site-lisp/ to load-path before loading debian-startup.el.

(add-to-list 'load-path "/usr/share/emacs/site-lisp")
(load "debian-startup")
  • Thank you! Just for the record, the problem was the same with the package emacs25 (25.3.2) but adding your lines to my init.el solved it.
    – djangonaut
    Dec 28 '19 at 20:05

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.