I upgraded to Ubuntu 20.04 Friday and have lost num Lock on boot - how can I set the system so that the keypad Num Lock is set on boot?

10 Answers 10


You can just set gnome to remember the Num Lock state between boots:

$ gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true
  • now works for me on kUbuntu 20.04
    – SL5net
    Commented Jan 24, 2022 at 18:47
  • Worked for me, Ubuntu 20.04 LTS with Gnome DE (although I'm using i3wm)
    – Godje
    Commented Jul 19, 2022 at 6:17

Thanks to this video,

I installed numlockx

sudo apt install numlockx

then setup a startrup application with "numlockx on" as the command.

  • It does not work on Ubuntu Studio 20.10. At login, I still have to hit the numlock key, in order to enter my password. Very annoying! Commented Mar 31, 2021 at 18:39
  • 2
    This solution does work for me, but I am still flabbergasted. I set up my BIOS that it turns the numlock on, but during startup Linux turns my numlock off (I believe other distro's have this behaviour as well). To me it sounds like going back 30+ years back in time: download some little tool from a bulletin board system, add it as an extra line to your autoexec.bat to overrule the mistake the OS made, because it is not capable to solve it itself.
    – ffonz
    Commented Apr 17, 2021 at 17:19

On Ubuntu 20.04.1

Source French: https://doc.ubuntu-fr.org/numlockx

$ sudo apt-get update

$ sudo apt-get install numlockx

Add this line after install numlockx:


on file "50-slick-greeter.conf"

Path to diretory:

 $ sudo nemo /usr/share/lightdm/lightdm.conf.d/50-slick-greeter.conf

greeter-setup-script=/usr/bin/numlockx on

From the K-Menu > Settings > System Settings > Input Devices (under Hardware) > Keyboard

The first option is "NumLock on Plasma Startup" just turn it on.

  • Unfortunately, this does not turn the NumLock on before login. Commented Mar 31, 2021 at 18:43
  • This is all I needed: but I could not find it with your instructions. in the start menu finder I search "lx" and went to the "keyboard and mouse" settings, then "keyboard", and tick the same setting "Turn on Numlock after login" So thank you, please add to your answer and I will upvote. Commented May 30, 2021 at 23:57
  • Thanks Mark, that did it for me.
    – user25406
    Commented Feb 2, 2023 at 15:40

No additional package needed, just follow this pathway:

Application Menu > Preferences > LXQt settings > Keyboard and Mouse > Keyboard > Turn on NumLock after login
  • 3
    Unfortunately, this does not turn the NumLock on before login. Commented Mar 31, 2021 at 18:43
  • 1
    I could not find this, remove the lxqt, and just type in "Keyboard" and the settings will appear. Please adjust your answer and I will up vote. Commented May 30, 2021 at 23:59
  • Thank you, I am using Lubuntu and this helped me. Maybe the other flavors including default Ubuntu also have this setting, as @NZ-Dev suggests.
    – semitones
    Commented Feb 26, 2022 at 14:40
  • Does not work for standard Ubuntu installations.
    – lindhe
    Commented Mar 17 at 17:59

This feature is temporarily broken. My preferred workaround uses xdotool (great for desktop automation), install if not already present. Place the following line in a startup script, or can be added to ~/.bashrc if terminal opens on startup:

xdotool key Num_Lock

To make persistent across suspends/hibernates, create (as root) /etc/pm/sleep.d/90_numlock-temp-fix with the following contents:

case "$1" in
    xdotool key Num_Lock

Backstory: The following two keys should work to both set numlock on and make that the default bootup state.

  • org.gnome.desktop.peripherals.keyboard numlock-state true
  • org.gnome.desktop.peripherals.keyboard remember-numlock-state true

In 20.04.1, at least so far, they are ignored.

Unused keys are typically a tipoff that the object controls are in a state of flux. There are several dealing with numlock so expect this to be fixed, hopefully in the next minor release (which should be out any time now?).

If these two keys are already set, watch for the bootup numlock state to return to 'off', which means the bug is fixed and this workaround can be removed. (Numlock will then boot 'on'.)

  • gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true, working for me on Ubuntu 20.04.3 LTS (GNOME 3.36.8) Commented Sep 10, 2021 at 6:31
  • not work of gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true here in kUbuntu 20.04
    – SL5net
    Commented Jan 24, 2022 at 18:45

Num-Lock can be set on the Input devices page in settings. BUT some computers set this in Bios. Boot to the Bios and look for it there as well.

  • I don't see "inout devices" in "settings" - I see Keyboard Shortvuts" and "Mouse & touchpad" but can't find any num Lock option and searching settings does not find any match on "num"... Commented May 18, 2020 at 22:21
  • 1
    It's not in the BOIS... Commented May 18, 2020 at 23:01
  • 1
    Yes Good call. I have search all over and the setting is simply not there. It was in earlier versions of Ubuntu. I am a Kubuntu guy. I have searched the web all over. I am blown away why something like that is not in settings. Commented May 20, 2020 at 6:58

Addition answer @Daniel Pablo Sheng: In Xubuntu 20.04 for me work this:

$ sudo gedit /usr/share/lightdm/lightdm.conf.d/50-xubuntu-numlock.conf

greeter-setup-script=/usr/bin/numlockx on


  • Can you please confirm whether anything else needs to be done: for example lightdm in my machine does not exist in the share directory. also numlockx would need to be installed right. could you update your answer to provide more clarity Commented May 30, 2021 at 23:53
  • You can try using the /etc/lightdm/lightdm.conf.d directory and create or edit files there. It all depends on the desktop environment you are using.
    – Alex_Krug
    Commented Jun 17, 2021 at 8:02

The "NumLock on Plasma Startup"-Option in Kubuntu 20.04 doesn't work.

Just installing numlockx from repository does the job.


This worked for me in MX-Linux 21.3 (Debian 11) with KDE-Plasma 5:111.

edit this file: /etc/sddm.conf.d/kde_settings.conf

under "[general]" add this:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .