previously worked

echo "pointer = 1 2 3 5 4 7 6 8 9 10 11 12" > ~/.Xmodmap && xmodmap ~/.Xmodmap 

didn't work

  • System Settings > Mouse and touchpad > Natural Scrolling
    – M. Becerra
    Apr 14, 2017 at 13:34
  • 1
    i don't have this setting(( Apr 14, 2017 at 13:48
  • System Settings > Mouse and touchpad > Natural Scrolling -- works for my mouse but not for touchpad.
    – Majal
    Apr 15, 2017 at 9:22
  • Try xmodmap -e 'pointer = 1 2 3 5 4' then, that works for me.
    – quuxman
    Nov 17, 2017 at 2:37
  • You can consider my answer on U&L - is it suitable to be posted here? No need for any uninstalling there. This U&L Q/A could also be relevant.
    – Cadoiz
    Jun 24, 2022 at 13:07

7 Answers 7


In my case, there was no need to remove any package. The only line which was missing in /usr/share/X11/xorg.conf.d/40-libinput.conf was:

Option "NaturalScrolling" "on"

so the whole section looked as the following:

  Section "InputClass"
          Identifier "libinput pointer catchall"
          MatchIsPointer "on"
          MatchDevicePath "/dev/input/event*"
          Option "NaturalScrolling" "on"
          Driver "libinput"

After restart of X session my mouse worked correctly.

  • 2
    Optionally put the new line inside the InputClass that has the touchpad identifier to only have natural scrolling for the touchpad.
    – kas
    Oct 20, 2018 at 21:52
  • 2
    This also works for Linux Mint 19.1 (Tessa).
    – trebormf
    Feb 6, 2019 at 19:24

For me, the solution was to leave xserver-xorg-input-libinput installed, and instead remove xserver-xorg-input-synaptics, then reboot. It seems as if the upgrade installed both and was choosing synaptic by default, which doesn't seem to have a natural scrolling option.

(I'm running Ubuntu Gnome 17.04 on a Dell XPS 15 9530, btw)

  • 1
    This worked for me on a Samsung N900X3B, I had to reboot for the change to take effect - note that there is an "s" at the end of xserver-xorg-input-synaptics
    – Decoy
    Apr 27, 2017 at 20:19
  • @Decoy Good catch, I'll make the edit
    – amiller27
    Apr 27, 2017 at 21:43
  • Worked for me without a reboot. Just had to log out and back in. (Ubuntu Gnome 17.04 on a Dell Inspiron 7500) Jul 5, 2017 at 13:59

I just upgraded from Ubuntu 16.10 to 17.04 and several things are broken, including natural mouse scrolling. note - I have a regular mouse (Evoluent) on a desktop, not a trackpad. I previously used this solution for Ubuntu 16: Reverse two finger scroll direction (natural scrolling)?, but this did NOT work in Ubuntu 17. Here is what worked for me in Ubuntu 17.04:

first, delete xserver-xorg-input-libinput package:

sudo apt remove xserver-xorg-input-libinput

then create file /usr/share/X11/xorg.conf.d/20-natural-scrolling-mouses.conf with this content:

Section "InputClass"
    Identifier "Natural Scrolling Mouses"
    MatchIsPointer "on"
    MatchIsTouchpad "off"
    MatchDevicePath "/dev/input/event*"
    Option "VertScrollDelta" "-1"
    Option "HorizScrollDelta" "-1"
    Option "DialDelta" "-1"

then restart your computer.

  • i didn't get how, but it helps! thx!!! Apr 17, 2017 at 7:44
  • For me, af removing xserver-xorg-input-libinput, my keyboard did not work anymore, and had to reinstall it. I'm running Ubuntu Gnome 17.04. Apr 19, 2017 at 6:19
  • This helped on Ubuntu Mate 17.04 after upgrade from 16.10. Works also for scrolling with trackpoint on Lenovo Thinkpad X230
    – Draco
    Apr 21, 2017 at 20:41
  • 1
    BEWARE. After uninstalling xserver-xorg-input-libinput I could not use my mouse and my keyboard anymore, so I could not log in. I had to boot with live cd and chroot to my broken OS, reinstall it to fix this. pretty annoying.
    – cheng bo
    Jun 10, 2017 at 4:51
  • This answer is terrible.
    – user70382
    Dec 4, 2018 at 6:22

The xinput command can be used to change this also. Put it in your .profile so it's executed on every startup. Here's what I put in mine:

# Set natural scrolling with apple mouse
# for usage information, type xinput by itself.  Other useful commands are
# xinput list-props 10   -- to find out settable property numbers (275)
# xinput list            -- to find out that 10 is the device ID of the mouse
xinput set-prop 10 275 -1 1 1
  • This works for me: xinput set-prop 10 "Evdev Scrolling Distance" -1 -1 -1 Sep 25, 2018 at 11:49
  • I just edited your answer for more clarity on the specific numbers 10 and 275 in your case. As you said, these are specific to your setup and drivers and that other users might need different ones. You can also enter text instead of the ids, but these can also be specific. You can consider my answer on U&L for more details.
    – Cadoiz
    Jun 24, 2022 at 13:10

In Ubuntu 18 the xinput properties for Kensington Trackball changed. Now to reverse the scroll ring direction you can use:

xinput set-prop 'Primax Kensington Eagle Trackball' 303 1

Not entirely sure this will translate from Ubuntu 16.04(LTS) to 17.04 and beyond, but it's a different solution than any of the other suggestions. It seems worth mentioning:

Use dconf editor

Find the setting: org.gnome.desktop.peripherals.mouse and check the box for "natural-scroll". The default is unchecked (false).

Not all options provided in dconf schemas are exposed in the UI. My guess is an attempt to keep the UI simple, which is IMO a worthy endeavor.

NOTE: It's unclear to me how dconf will interact with a previously configured xinput. Is dconf twiddling the same xinput settings? Is dconf an actual layer on top of xinput such that if you changed the setting in both places it would be effectively undone? It only matters if you forget and try both things...

  • 1
    On terminal would be gsettings set org.gnome.desktop.peripherals.mouse natural-scroll true Dec 3, 2019 at 18:40

In newer versions of Ubuntu (Ubuntu 21.04, for instance), you can change this setting like this:

  1. Open "Settings"
  2. Navigate to "Mouse & Touchpad" in the left sidebar
  3. Enable "Natural Scrolling"


You must log in to answer this question.

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