Enable/Disable Location Service in Ubuntu 22.04, 20.04 & Debian 11 [Different ways]

This simple tutorial shows how to disable (or enable) location service in GNOME desktop via different ways!

GNOME, the default desktop for Ubuntu, Fedora & Debian, etc, has built-in location services allows to determine your current location. Which is useful for use in setting your timezone and by applications such as Maps.

To protect user privacy, you may use whitelist or select to disable this service. And, here’s how to do the trick via different ways.

Method 1: Toggle on/ff Location Service via Settings:

The system settings tool has the on/off switch to toggle this service. Just do the steps below one by one will find it.

1. Open ‘Settings’ either from top-right corner system tray menu, or by searching from ‘Activities’ overview.

Open Settings

2. Next, click on ‘Privacy’ from the left pane of the Settings utility.

2. You’ll finally see the on/off switch in the header of the ‘Location Services’ setting page. Just turn on or off the option as mind and enjoy!

Method 2: Disable Location Service via gsettings command:

If you would like to disable the feature from command line, then the gsettings command may help.

Firstly, search for and open a terminal windows from ‘Activities’ overview screen (Ubuntu user may just press Ctrl+Alt+T on keyboard).

Then, paste the command below in terminal and hit run:

gsettings set org.gnome.system.location enabled false

The command will disable the service immediately. And, you may re-enable it by replace false with true in the command.

Method 3: Disable Location background service:

The geolocation is controlled by the “geoclue” system service that runs silently in the background.

For choice user may choose to disable the service by running the commands below, though it needs admin account password authentication.

  • Check the geoclue service status via command:
    systemctl status geoclue.service
  • Stop the geoclue service using command:
    systemctl stop geoclue.service
  • Disable the service, so it won’t start automatically in next boot:
    systemctl disable geoclue.service
  • You may even mask it (stronger version of disable) via:
    systemctl mask geoclue.service

And, undo the previous actions by running the command below accordingly:

systemctl unmask geoclue.service
systemctl enable geoclue.service
systemctl start geoclue.service

Method 4: Control location service whitelist

Without disabling the service, you may control the whitelist to decide which app can get your location!

To do so, open terminal and run command:

sudo xdg-open /etc/geoclue/geoclue.conf

This command will open the configuration file with system default text editor. When the file opens, find out the line starts with ‘whitelist=’ and change the value to add/remove apps allowed to access your location.

As you see in the picture, there you may configure which source (CDMA, GPS, or WiFi) to use as well as some other settings. After saving the changes, restart the service to apply:

systemctl restart geoclue.service

That’s all. Enjoy!

Merilyn Ne
Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.