Location services now fail due to Mozilla Location Service being shut down on June 12, 2024. Here, I show a way to obtain geoclue information by hard-coding a location using lat/long, instead of a wireless connection to a now non-existent Mozilla service.
To see the failure:
sudo systemctl status geoclue
Here is a way to use a hard-coded location to make geoclue/location services work again.
Use https://www.gps-coordinates.net/my-location to obtain your current static location.
Create a textfile /etc/geolocation containing your coordinates, e.g.:
50.12345 # latitude
5.12345 # longitude
5 # altitude
1 # accuracy radius
Note:
For extra security, the static location file can be made readable just
by the geoclue user:
sudo chown geoclue /etc/geolocation
sudo chmod 600 /etc/geolocation
Then in /etc/geoclue/geoclue.conf you can disable the geolocation options and enable the static location, e.g.:
# Enable WiFi source
enable=false
Enable the static source
If you make use of this source, you probably should disable other location
sources in this file so they won't override the configured static location.
enable=true
https://discussion.fedoraproject.org/t/geoclue-location-query-broken-due-to-mozilla-service-retirement/128262
Then restart geoclue:
sudo systemctl restart geoclue