My weather widget doesn't work anymore. I'm using Ubuntu MATE. Here is a screenshot:
The US government changed something and broke the data used by these apps (broke my conky too).
The entire ‘weather.noaa.gov‘ URL the app references shows a “Service Removed” error. GNOME Weather (or more specifically the library libgweather) uses this URL to fetch its METAR data. It needs to be updated to work with changes made to the domain structure for NOAA’s METAR delivery.
The weather information in METAR format was being downloaded from the NOAA website (it was world wide information) via the libgnomeweather library (and later via the libmateweather library). Around four years ago the NOAA announced it would discontinue that service. Apparently nobody noticed and when the service was discontinued a couple of weeks ago people started to find the message
Failed to get METAR data: 404 Not Found in the syslog log (or in my case
Falló al obtener datos METAR: 404 Not Found., as my computer is in Spanish).
UPDATE: this has already been fixed in the latest libmateweather (1.12.2) released for Ubuntu Mate 16.04, so this solution is not needed anymore. (However, that version may not work behind a proxy, but that's a different problem).
The fix to this has already been implemented in libmateweather, you can see the patch in the Mate Desktop GitHub repository as commit 835055e0d0b950d3f66ad236de7e40942f6f7d8e. However, it is not clear to me if this fix will be distributed for this Ubuntu Mate LTS (16.04) or not (as this is not really a security fix). Apparently it will be distributed for 16.10, as according to a post in the Mate Desktop blog regarding "known issues" with 16.10:
Weather reports in the Clock and Weather applets are currently unavailable. A fix has already been committed and an updated package will land soon after Beta 1.
This is how I fixed it in my computer (recompile the libmateweather using the Ubuntu sources):
Enable sources downloading in APT. You can do this in the System / Administration / Software and Updates dialog, by checking the Source code item in the Ubuntu software tab. You can also enable them in the /etc/apt/sources.list file.
Using the MATE Terminal (or any other terminal program or directly in the Linux console), create a temporary directory where you can compile the libmateweather sources (for example,
mkdir newlibmateweather) then change to that directory (
Download the sources of libmateweather (
apt-get source libmateweather), note this does not require to use sudo).
Install the dependencies required to build the package (
sudo apt-get build-dep libmateweather). Also install the fakeroot package (
sudo apt-get install fakeroot).
At line 525, change
"National Weather Service"to
"AVIATION WEATHER CENTER"
At line 553, change
At line 554, change
Change to the library source directory (
Create .deb packages (
dpkg-buildpackage -rfakeroot -uc -b). This may take a while. At the end you will find several .deb files in the parent directory according to the architecture of your computer (for example, in mine, that created libmateweather1_1.12.1-1_amd64.deb, libmateweather1-dbg_1.12.1-1_amd64.deb, libmateweather-common_1.12.1-1_all.deb and libmateweather-dev_1.12.1-1_amd64.deb.
Install the main lib package you just compiled (
sudo dpkg -i libmateweather1_1.12.1-1_amd64.deb).
You may need to restart the applet(s) or the whole panel or remove it and then add it or logout and login again.
All required packages to recompile libmateweather will be installed automatically when you run the apt-get build-dep command and when you install the fakeroot package.
I'm not sure what will happen if a new version of libmateweather is released and distributed for 16.04 (my guess is that this change will be overwritten). However, if a new version is released for this LTS then it may include (or not) this fix. A way to avoid that (the overwriting) is to use
sudo apt-mark hold libmateweather1.
If you have multiple computers, just compile this once per-architecture and use the .deb file in all your computers. If you have lots of computers to maintain (in your company, organization, school or whatever), a more complete solution would be to create a local private repository so that APT can install the package automatically from it.