In Ubuntu 16.04 i was able to open numlock on login screen as default with the help of this url:

How to enable numlock at boot time for login screen?

However it doesn't work with Ubuntu 18.04.It throws an error saying that there is no rc.local directory.

Is there a way to fix this?

Your help is very appreciated!

Thanks a lot.

2 Answers 2


@bonhomag solution worked for me in 18.04 (original post):

You need to set it as gdm user via gsettings command

The solution that should work:

  1. Open terminal via Ctrl+Alt+T, then run command to get root privilege:

    sudo -i

  2. Switch to user gdm in the terminal:

    su gdm -s /bin/bash

  3. Finally set ‘Numlock on’ via gdm user:

    gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state 'on'

Restart the computer and done

  • I get : Command 'gdm' not found
    – Hakaishin
    Jul 26, 2019 at 7:02

There is a package for numlockx in bionic, version 1.2-7ubuntu1. So apt install numlockxshould do first part of the solution you linked above.

The problem is, there is no rc.local to start it anymore. You will need to configure systemd to run numlockx once after startup like rc.local would have done. This was already described here: How can I execute command on startup (rc.local alternative) on Ubuntu 16.10

Alternatively, you could go with the second answer in the linked answer.

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.