Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
447
views
Precise geolocation incorrect across all internet browsers and websites in Arch Linux
For the last month or so, I've noticed that my device's precise location is frequently, if not always, incorrect on websites like google maps. This extends to google search results as well - at the moment, on Firefox, google thinks I'm in Vietnam (I'm actually in the US) and I'm getting search resul...
For the last month or so, I've noticed that my device's precise location is frequently, if not always, incorrect on websites like google maps. This extends to google search results as well - at the moment, on Firefox, google thinks I'm in Vietnam (I'm actually in the US) and I'm getting search results in Vietnamese. I've tried different browsers and different websites like bing maps, and the results are the same. Here's what I know:
- I am not running a VPN
- My location is correct on my smartphone and in google maps on a different machine, both of which are on the same wifi network and logged in to my google account
- My IP location from sites like ipinfo.io is correct
- Google maps shows the correct area when first opening, before selecting "use precise location"
- Changing the value
geo.provider.network.url
from https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_LOCATION_SERVICE_API_KEY%
to https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%
as described here caused the location to change. Originally, google maps in Firefox would show me in Germany. After changing that value, it started to show me in Vietnam. Changing it back to the googleapis provider did not cause the location to change back to Germany from Vietnam. This also changed the results in Chromium which doesn't make a whole lot of sense to me, especially considering my next point
- Chromium now shows the correct location after I completely cleared all browsing data. It has only been a few minutes since discovering this and it is still working, both logged in to google and not logged in. I have not tried clearing my history and data in Firefox yet, and the location is still wrong there - even in a private browser.
Has anyone else had an issue like this? I suppose all I need to do right now is clear my data in Firefox, but I'm not convinced that there isn't a more interesting underlying issue. Any pointers would be greatly appreciated.
zackd97
(21 rep)
Mar 16, 2023, 04:15 AM
• Last activity: Jun 2, 2025, 10:18 PM
0
votes
2
answers
260
views
Viking GPS editor/viewer: how to scroll the map while entering points in a track?
I just discovered the (great) [Viking][1] application for editing and viewing GPS tracks. I am struggling to find a way to scroll the map while I am editing?adding points to a track or a route, like in the following case: ![enter image description here][2] I know I can click on the "four arrow" symb...
I just discovered the (great) Viking application for editing and viewing GPS tracks.
I am struggling to find a way to scroll the map while I am editing?adding points to a track or a route, like in the following case:
I know I can click on the "four arrow" symbol and then move the map, but this will exit the track editing mode --- I have to select "extend track" to continue each time.
I am sure there should be a better method, but I am unable to find it.
Is there a way to scroll the map while in track editing mode?

Rmano
(3475 rep)
May 5, 2014, 04:41 PM
• Last activity: May 31, 2025, 09:30 PM
13
votes
3
answers
23479
views
geoclue2: how to get location and configure
At the command line, how do I get the current location that `geoclue2` would report? There's no man page or `bin/` executable in my Arch package. `redshift` (which uses `geoclue2`) is reporting my location as: > 7.98 98.37 But google maps gives me: > 9.749160, 99.975484 Is there any way to configure...
At the command line, how do I get the current location that
geoclue2
would report?
There's no man page or bin/
executable in my Arch package.
redshift
(which uses geoclue2
) is reporting my location as:
> 7.98 98.37
But google maps gives me:
> 9.749160, 99.975484
Is there any way to configure what sources geoclue2
uses to get better accuracy?
Most google geoclue2
searches bring up redshift
which isn't too helpful :(
Tom Hale
(32922 rep)
Nov 5, 2018, 11:28 AM
• Last activity: Mar 25, 2025, 02:56 PM
1
votes
3
answers
108
views
Loop ip list through geoiplookup and delete lines that do not match criteria
Thanks in advance for any ideas you present. My current project has me trying to loop a file containing a list of 1000's of IP addresses through geoiplookup and piping it to sed to delete all lines that do not match criteria. The list is just a list of ip addresses: ``` 1.2.3.4 5.6.7.8 9.10.11.12 ....
Thanks in advance for any ideas you present.
My current project has me trying to loop a file containing a list of 1000's of IP addresses through geoiplookup and piping it to sed to delete all lines that do not match criteria.
The list is just a list of ip addresses:
1.2.3.4
5.6.7.8
9.10.11.12
.
.
.
I then run geoiplookup ip.ad.dre.ss
as root, and get:
[root@system ipset]# geoiplookup 4.2.2.2
GeoIP Country Edition: US, United States
if the IP is within the US.
My goal is to delete all lines from the file, if their IP is not in the US.
What I tried is not working:
#!/bin/bash
for ip in $(cat /tmp/iplist.txt); do
geoiplookup $ip | sed '/GeoIP Country Edition: US, United States/!d'
done
Any suggestions? Recommendations of another approach would be greatly appreciated.
@terdon Sorry I haven't updated sooner, I have been busy.
Adding either to this question or comment messes up formatting of text. Sorry newbie to Stack...let me figure this out.
OK, update.
after changing up and running @terdon first code:
#!/bin/bash
while read ip; do
if ! geoiplookup "$ip" | grep -q ': US, United States$'; then
sed -i "/^$ip$/d" /tmp/iplist.txt
fi
done < /tmp/iplist.txt
it runs without error but non-US ip address still are in list.
I had been using the last example with the declare -a badLines
scripts#geoiplookup 172.168.155.63
GeoIP Country Edition: GB, United Kingdom
scripts#grep 172.168.155.63 /tmp/iplist.txt
172.168.155.63
Once I figure out how to get copy and paste to work right into the question here I will update.
@Ed Morton
Both examples produce same error at the "done" line, line 7 in one and line 9 in the other.
./filter_ips.sh: line 7: syntax error near unexpected token `done'
./filter_ips.sh: line 7: ` done < "${@:--}"'
@Miri B
They run through but there are still non-US ip addresses in the list.
user711431
Feb 10, 2025, 12:41 PM
• Last activity: Feb 11, 2025, 10:49 PM
0
votes
2
answers
3913
views
CentOS force dnf to use mirrors of a specific location
Using CentOS 8. I would like to force `dnf` to only use mirrors in the vicinity of a certain location without having to manually maintain a list of desirable mirrors. So I looked to modify the repo config files in `/etc/yum.repo.d/`. Take `/etc/yum.repo.d/CentOS-Linux-BaseOS.repo` for example, this...
Using CentOS 8.
I would like to force
dnf
to only use mirrors in the vicinity of a certain location without having to manually maintain a list of desirable mirrors. So I looked to modify the repo config files in /etc/yum.repo.d/
.
Take /etc/yum.repo.d/CentOS-Linux-BaseOS.repo
for example, this is its default state:
[baseos]
name=CentOS Linux $releasever - BaseOS
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
I would like to know if there is a parameter when querying mirrorlist.centos.org
I can specify to filter by location, something like this:
mirrorlist=http://mirrorlist.centos.org/?country=us&other-params-ommitted
(country=
I tried, didn't do anything)
I haven't been able to find any relevant documentation on the site's API.
cyqsimon
(905 rep)
Sep 15, 2021, 08:55 AM
• Last activity: Oct 30, 2024, 12:47 AM
6
votes
1
answers
4643
views
geoclue "Failed to query location: Not Found"
I have noticed that `redshift` does not work anymore on my machine with Linux Mint 21.3. I am sure that about half a year ago it was still working (that could be under Linux Mint 21.2 though). Trying to debug this, I found out that the problem must be with `geoclue`: ```console $ redshift Trying loc...
I have noticed that
redshift
does not work anymore on my machine with Linux Mint 21.3. I am sure that about half a year ago it was still working (that could be under Linux Mint 21.2 though). Trying to debug this, I found out that the problem must be with geoclue
:
$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Using method `randr'.
Waiting for initial location to become available...
^Cpoll: Interrupted system call
Unable to get location from provider.
(I do not know why it talks about wayland, it is not a wayland session.)
Executing /usr/libexec/geoclue-2.0/demos/where-am-i
from geoclue-2-demo
package just times out after a while without any output or error. (Sometimes it did produce some error message about something missing IIRC, but I could not reproduce it reliably.)
Here is the status of geoclue.service
:
$ systemctl status geoclue.service | cat
● geoclue.service - Location Lookup Service
Loaded: loaded (/lib/systemd/system/geoclue.service; static)
Active: active (running) since Sat 2024-06-15 13:53:51 CEST; 7min ago
Main PID: 2434 (geoclue)
Tasks: 4 (limit: 18810)
Memory: 19.1M
CPU: 424ms
CGroup: /system.slice/geoclue.service
└─2434 /usr/libexec/geoclue
Jun 15 13:53:51 Alexey-InfinityBook-Mint systemd: Started Location Lookup Service.
Jun 15 13:54:12 Alexey-InfinityBook-Mint geoclue: Failed to query location: Not Found
Jun 15 13:54:17 Alexey-InfinityBook-Mint geoclue: Failed to query location: Not Found
[...]
Googling "geoclue.service Failed to query location Not Found" did not return anything relevant on the top of the search results.
I have the same problem (at least it looks the same) under LMDE 6 (Linux Mint Debian Edition).
Any help will be appreciated.
Alexey
(2310 rep)
Jun 15, 2024, 12:21 PM
• Last activity: Jun 16, 2024, 09:57 PM
0
votes
1
answers
123
views
Cloudflare resolves but Google doesn't. Why?
I am in Mexico. This fails: ``` % curl -s -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=www.bispebjerghospital.dk&type=A' | jq . { "Status": 2, "TC": false, "RD": true, "RA": true, "AD": false, "CD": false, "Question": [ { "name": "www.bispebjerghospital.dk", "type": 1...
I am in Mexico.
This fails:
% curl -s -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=www.bispebjerghospital.dk&type=A ' | jq .
{
"Status": 2,
"TC": false,
"RD": true,
"RA": true,
"AD": false,
"CD": false,
"Question": [
{
"name": "www.bispebjerghospital.dk",
"type": 1
}
],
"Comment": [
"EDE(22): No Reachable Authority (time limit exceeded)"
]
}
but this succeeds:
dig @8.8.8.8 www.bispebjerghospital.dk
Why? What requirements does Cloudflare require of a domain to resolve its record?
The map shown at [whatsmydns](https://whatsmydns.net/#A/www.bispebjerghospital.dk) shows red X's for some locations.
EDIT: Marcus in the comments seems to have no issue with the Cloudflare. So since I suspect this is an anycast issue, here are the IP addresses I see for Cloudflare:
% nslookup cloudflare-dns.com
Server: 10.2.9.68
Address: 10.2.9.68#53
Non-authoritative answer:
Name: cloudflare-dns.com
Address: 104.16.249.249
Name: cloudflare-dns.com
Address: 104.16.248.249
Name: cloudflare-dns.com
Address: 2606:4700::6810:f9f9
Name: cloudflare-dns.com
Address: 2606:4700::6810:f8f9
EDIT2: NS records as requested:
% dig www.bispebjerghospital.dk NS
;; communications error to 10.2.9.68#53: timed out
; > DiG 9.18.24-1-Debian > www.bispebjerghospital.dk NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER> DiG 9.18.24-1-Debian > @8.8.8.8 www.bispebjerghospital.dk NS
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40469
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.bispebjerghospital.dk. IN NS
;; AUTHORITY SECTION:
bispebjerghospital.dk. 900 IN SOA ns3.regionh.dk. webmasteradmin.regionh.dk. 2008030648 10800 3600 2592000 900
;; Query time: 256 msec
;; SERVER: 8.8.8.8#53(8.8.8.8) (UDP)
;; WHEN: Tue Apr 02 12:58:38 CST 2024
;; MSG SIZE rcvd: 117
% dig +short cloudflare-dns.com NS
ns1.cloudflare-dns.com.
ns2.cloudflare-dns.com.
ns3.cloudflare-dns.com.
EDIT3: NextDNS succeeds:
% curl -s -H 'accept: application/dns-json' 'https://dns.nextdns.io/dns-query?name=www.bispebjerghospital.dk&type=A ' | jq .
{
"Status": 0,
"TC": false,
"RD": true,
"RA": true,
"AD": false,
"CD": false,
"Question": [
{
"name": "www.bispebjerghospital.dk.",
"type": 1
}
],
"Answer": [
{
"name": "www.bispebjerghospital.dk.",
"type": 1,
"TTL": 3600,
"data": "128.0.75.219"
}
]
}
EDIT4: I can't query from ns3.region.dk directly:
% dig @ns3.regionh.dk www.bispebjerghospital.dk
;; communications error to 128.0.75.226#53: timed out
EDIT5: Seems like that previous command should have worked, since it works on [dnsexit.com](https://dnsexit.com/it-tools/network-tools) :

Janus Troelsen
(1515 rep)
Apr 2, 2024, 06:13 PM
• Last activity: Apr 2, 2024, 07:23 PM
25
votes
4
answers
25160
views
Automatically set Linux timezone according to location
How can we automatically set the system default timezone in Linux using the Internet? As I see it, NTP servers can update only time, but not timezone. Is there any server that can change the timezone?
How can we automatically set the system default timezone in Linux using the Internet? As I see it, NTP servers can update only time, but not timezone. Is there any server that can change the timezone?
Embedded Programmer
(431 rep)
Sep 12, 2013, 02:23 AM
• Last activity: Nov 18, 2023, 10:42 AM
0
votes
0
answers
245
views
Geo-spoofing (a desktop app for Debian)?
I want to spoof my location on my android device without jailbreaking. I saw this [post][1] about desktop software that can spoof mobile device via usb. Can you please help me find a free alternative that can be installed on a debain laptop? [1]: https://www.fonegeek.com/change-location/best-gps-loc...
I want to spoof my location on my android device without jailbreaking.
I saw this post about desktop software that can spoof mobile device via usb. Can you please help me find a free alternative that can be installed on a debain laptop?
Elad Benda
(125 rep)
Aug 3, 2023, 06:18 PM
3
votes
1
answers
4796
views
is there a command or a way to find how good or bad is the Geoclue Demo Agent?
In startup applications in Debian (as possibly other debian and ubuntu based distros.) there is a library called Geoclue Demo agent, the actual library with path is /usr/libexec/geoclue-2.0/demos/agent which is part of geoclue-2.0 https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home . The only...
In startup applications in Debian (as possibly other debian and ubuntu based distros.) there is a library called Geoclue Demo agent, the actual library with path is
/usr/libexec/geoclue-2.0/demos/agent
which is part of geoclue-2.0 https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home .
The only question I know which has been asked so far is to remove the app/service. See the question from unix.stackexchange.com .
I would find it more interesting if I could understand what it shows and how it shows it. The manpage written about man geoclue isn't addressed for ordinary users.
Can somebody help me with that ? I am looking on lines something simple as
curl wttr.in/$location
and you get output of weather of that location. Something which is interactive and it probably is, just need to figure out how.
shirish
(12954 rep)
Apr 17, 2020, 02:23 PM
• Last activity: Jun 21, 2023, 01:01 PM
1
votes
0
answers
224
views
GPSD, How to get the last known location?
if GPS-module disconnected, or if GPS antenna gets moved into building, I wan't to know the last available location. I tried to log location every 10 or so seconds with systemd-timers; However, exactly when log-file is updating every 10 sec, there is an instance `cat` -ing log-file returns empty. Th...
if GPS-module disconnected,
or if GPS antenna gets moved into building, I wan't to know the last available location.
I tried to log location every 10 or so seconds with systemd-timers; However, exactly when log-file is updating every 10 sec, there is an instance
cat
-ing log-file returns empty. This needs to be robust as possible, since inexperienced user will be operating the system.
Are there anything tools within GPSD tools that provide this?
Garid Z.
(552 rep)
Apr 1, 2022, 02:03 AM
3
votes
4
answers
994
views
Extracting sea level pressure from KML using Shell
I'm currently working on a little project; in a kml file called weatherdata.kml, I would like to extract the sea level pressure for each ` ` element. I'm trying to parse the information about the sea level pressure and put it into a file called `report.csv`; and print the sea level pressure on a new...
I'm currently working on a little project; in a kml file called weatherdata.kml, I would like to extract the sea level pressure for each `
element. I'm trying to parse the information about the sea level pressure and put it into a file called
report.csv`; and print the sea level pressure on a new line each time.
I think this would work with awk
and so far I've tried this:
awk -F '[>,]' '/minSeaLevelPres/ {print $2}' report.csv
But when I run this command in shell, I get this:
1002
#ex
19.2
-24.1
NINE
10
AL
LO
20
23
37
1002
2020082350
0000 UTC JAN 07
user518378
Mar 14, 2022, 08:27 PM
• Last activity: Mar 15, 2022, 11:34 AM
1
votes
0
answers
10
views
How can I manage specific setting profiles for different physical locations (office vs home)?
On my KDE Neon laptop, I would like to have several profiles which encompass the settings for: - network (Wifi vs LAN) - display (including external displays via `xrandr` or display manager) - audio outputs (internal vs. external audio device) Is there a standard way to manage "profiles" like the on...
On my KDE Neon laptop, I would like to have several profiles which encompass the settings for:
- network (Wifi vs LAN)
- display (including external displays via
xrandr
or display manager)
- audio outputs (internal vs. external audio device)
Is there a standard way to manage "profiles" like the ones above without homebrewing a custom bash script?
If so, is it also possible to automatically switch between the profiles based on (for example) the availability of certain WiFi networks?
RafDouglas C. Tommasi
(473 rep)
Nov 3, 2021, 07:40 AM
2
votes
2
answers
13145
views
How to block countries (iptables OR firewalld) by GeoLite2 mmdb
How to use GeoLite2 database (mmdb) in my firewalld to block all countries except for example DE?
How to use GeoLite2 database (mmdb) in my firewalld to block all countries except for example DE?
Baterka
(121 rep)
Feb 25, 2019, 03:05 PM
• Last activity: May 31, 2021, 07:15 AM
16
votes
3
answers
14049
views
uninstall geoclue from debian
Using Debian 8 Jessie I don't like `geoclue`. I want to remove it Tried to do: apt-get remove geoclue* I got: The following packages will be REMOVED: empathy geoclue-2.0 gnome gnome-clocks gnome-core gnome-maps task-gnome-desktop Is there a way to remove it without uninstalling the whole gnome ? I d...
Using Debian 8 Jessie
I don't like
geoclue
. I want to remove it
Tried to do:
apt-get remove geoclue*
I got:
The following packages will be REMOVED:
empathy geoclue-2.0 gnome gnome-clocks gnome-core gnome-maps
task-gnome-desktop
Is there a way to remove it without uninstalling the whole gnome ? I don't have any window manager besides gnome I don't want to brick my install.
Thanks
opc0de
(323 rep)
Aug 20, 2015, 07:06 PM
• Last activity: Dec 19, 2020, 06:23 AM
-1
votes
1
answers
1220
views
How to search OpenStreetMap for tags?
How can I have e.g. all [highway speed cameras][2] displayed on the map, i.e. what is the URL syntax to search [OpenStreetMap][1] for certain **tags**? [1]: https://www.openstreetmap.org [2]: https://wiki.openstreetmap.org/wiki/Tag:highway%3Dspeed_camera
How can I have e.g. all highway speed cameras displayed on the map, i.e. what is the URL syntax to search OpenStreetMap for certain **tags**?
david
(359 rep)
Jul 23, 2020, 01:06 AM
• Last activity: Aug 5, 2020, 03:22 PM
0
votes
1
answers
319
views
Does the system need to be at the right hour in order to get a GPS fix
I am using an ARM device on which Debian is installed. A GPS chip is installed on the machine and I use it in my program. That being said, it seems extremely, long, or sometimes impossible to even get a fix. My device does not have a clock. Depending on the available sources, I may set the system da...
I am using an ARM device on which Debian is installed. A GPS chip is installed on the machine and I use it in my program.
That being said, it seems extremely, long, or sometimes impossible to even get a fix.
My device does not have a clock. Depending on the available sources, I may set the system data from somewhere else (IE if the user connected the device to the WIFI)
I don't really know how timezones operate. My country has only one and it changes according to the season.
My first question would be:
- In Debian, is the system time relevant to get a GPS fix?
- If so, what type of date must I set? My country uses GMT but it seems weird for a satellite to even care about that type of concept, I assume they use UTC - is this the case? Right now I'm off by one hour... I think. (09:05 UTC while my country's clock seems to be 10:05)
Tohkai
(35 rep)
Feb 24, 2020, 09:07 AM
• Last activity: Feb 24, 2020, 11:12 AM
4
votes
1
answers
2225
views
How does gnome-maps get my current location?
On my desktop computer (arch) and laptop (debian) I use gnome-maps. On both devices I use a VPN. (`iptables` firewall does not allow non-VPN traffic, no DNS leaks.) On my desktop, the "current location" is the city where the VPN is, as expected. On my laptop however, gnome-maps is able to get my act...
On my desktop computer (arch) and laptop (debian) I use gnome-maps. On both devices I use a VPN. (
iptables
firewall does not allow non-VPN traffic, no DNS leaks.)
On my desktop, the "current location" is the city where the VPN is, as expected.
On my laptop however, gnome-maps is able to get my actual location (VERY precisely, almost down to the foot).
How is that possible? What techniques are used? The laptop does not have GPS.
confetti
(2134 rep)
Jan 31, 2020, 01:10 PM
• Last activity: Jan 31, 2020, 01:55 PM
19
votes
4
answers
26447
views
Get my country by IP in bash
I want to use the name of the country where I am now in a bash script. I can get the external IP using next command: curl ifconfig.me But how can I get my country name?
I want to use the name of the country where I am now in a bash script. I can get the external IP using next command:
curl ifconfig.me
But how can I get my country name?
Radu Rădeanu
(1813 rep)
Jul 18, 2013, 10:22 AM
• Last activity: Nov 30, 2019, 09:48 AM
3
votes
1
answers
4040
views
Geoclue2 insists that permission is forbidden
I am trying to get Redshift to work again. And it seems to fail because of geoclue2. Here's the weird thing. Until earlier today, it worked just fine, and geoclue was not updated since December (2.5.2). Whatever I do, I keep getting the following > geoclue[2905]: Failed to query location: Forbidden...
I am trying to get Redshift to work again. And it seems to fail because of geoclue2.
Here's the weird thing. Until earlier today, it worked just fine, and geoclue was not updated since December (2.5.2).
Whatever I do, I keep getting the following
> geoclue: Failed to query location: Forbidden
When I run
systemctl status geoclue.service
.
**Nothing** works. Not downgrading redshift, or geoclue2, or even running as sudo
the redshift process. Absolutely nothing. It all ends up in the same result: forbidden.
(Yes, I have added redshift to the geoclue.conf
file at /etc/geoclue/geoclue.conf
.)
---
I am using Arch Linux with Openbox and Xinitrc.
Ink blot
(203 rep)
Jan 18, 2019, 06:33 PM
• Last activity: Jan 19, 2019, 03:40 PM
Showing page 1 of 20 total questions