Fix: Failed to run Redshift: Trying location provider geoclue2

Do you get the following error message: Failed to run Redshift: Trying location provider `geoclue2'... when you try to open Redshift? Here are a few solutions.

Solution 1: Turn on Location Services

  1. Open settings.
  2. Click on Privacy located in the left menu.
  3. Click on Location Services.
  4. Click on the toggle button next to Location Services to switch it on.
    Turn on Location Services in Ubuntu
  5. Close settings.

Solution 2: Install GeoClue

  1. Open a terminal window.
  2. Type (or copy and paste) the following command:
    
    sudo apt-get install geoclue-2.0
    
    
  3. Press the Enter key on your keyboard.
  4. Enter your password.
  5. Press Enter.
  6. You can close the terminal window after the installation is complete.

Solution 3: Edit the GeoClue configuration file

Add the following lines to the geoclue.conf file:


[redshift]
allowed=true
system=false
users=

You can find the geoclue config file in the following location: /etc/geoclue/geoclue.conf.

  1. Open a terminal window.
  2. Type (or copy and paste) the following command:
    
    sudo nano /etc/geoclue/geoclue.conf
    
    
  3. Press the Enter key on your keyboard.
  4. Enter your password.
  5. Press Enter.
  6. Go to the bottom of the geoclue.conf file by using the arrow down key on your keyboard.
  7. Type (or copy and paste) the following lines:
    
    [redshift]
    allowed=true
    system=false
    users=
    
    
  8. Press the Ctrl + X keys on your keyboard.
  9. Press the Y key on your keyboard to save the changes.
  10. Press Enter.
  11. You can close the terminal window.

Solution 4: Downgrade GeoClue

This solution came from someone who uses Fedora.

  1. Open a terminal window.
  2. Type (or copy and paste) the following command:
    
    sudo dnf downgrade geoclue2.x86_64
    
    
  3. Press the Enter key on your keyboard.
  4. Enter your password.
  5. Press Enter.
  6. You can close the terminal window after the downgrade is complete.

Solution #5: Edit the Redshift configuration file

Add the following lines to the redshift.conf file:


[redshift]
temp-day=15000
temp-night=3200
fade=1
location-provider=manual

[manual]
lat=52.3
lon=4.9

You can find the Redshift configuration file in the following location: /home/YourUsername/.config/redshift.conf. If the redshift.conf file is not there, you will have to create it.

You can open the Redshift configuration file using the following command:


sudo nano /home/YourUsername/.config/redshift.conf

The meaning of the lines in the Redshift configuration file:

  • temp-day is the color temperature for day time.
  • temp-night is the color temperature for night time.
  • fade is to make the transition between color temperatures smooth and not suddenly.
  • location-provider=manual allows us to enter our location manually so that Redshift will know the sunrise and sunset times by itself according to the latitude and longitude information we enter.
  • lat is the latitude of our location.
  • lon is the longitude of our location.

Steps

  1. Open a terminal window.
  2. Type (or copy and paste) the following command:
    
    sudo nano /home/YourUsername/.config/redshift.conf
    
    
  3. Press the Enter key on your keyboard.
  4. Enter your password.
  5. Press Enter.
  6. Add the following lines to the redshift.conf file:
    
    [redshift]
    temp-day=15000
    temp-night=3200
    fade=1
    location-provider=manual
    
    [manual]
    lat=52.3
    lon=4.9
    
    
  7. Press the Ctrl + X keys on your keyboard.
  8. Press the Y key on your keyboard to save the changes.
  9. Press Enter.
  10. You can close the terminal window.


Linux


References:

https://fosspost.org/redshift-night-light-on-linux