OPKG update fails with "wget returned 1" (22.03.2)

Running OpenWrt 22.03.2 r19803-9a599fee93 / LuCI openwrt-22.03 branch git-22.288.45147-96ec0cd

I've been creating a new configuration to tie down my firewall configuration further after installing Wireguard. However, I ran into a problem where I couldn't get my DDNS working most probably because of the firewall config being too strict no doubt.

I noticed on the Luci DDNS page reference to wget and curl for binding interfaces. I tried to update the OPKG packages so I could then do the install but it failed, I thought most probably a DNS issue again related to my config.

So I restored to a config from a couple of weeks back with a more relaxed firewall config that I'm pretty sure worked fine from an OPKG update perspective but no longer seems to work either?

Here's the output from the opkg update command....

root@OpenWrt1:~# opkg update
Downloading https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/base/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/base/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/luci/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/luci/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/routing/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/routing/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/telephony/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/telephony/Packages.gz

Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz, wget returned 1.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/base/Packages.gz, wget returned 1.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/luci/Packages.gz, wget returned 1.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/packages/Packages.gz, wget returned 1.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/routing/Packages.gz, wget returned 1.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.2/packages/mipsel_24kc/telephony/Packages.gz, wget returned 1.

ping and nslookup to external sources works perfectly well and everything else seems fine except the OPKG updates?

Probably something obvious I've missed but wondered if any thoughts on what this might be please? Can post configs if needed

Thanks

You might just try manually wget (one of) those files from the ssh console.
That might provide a better error than "wget returned 1".

(opkg uses wget or uclient-fetch as the download tool.)

root@OpenWrt1:~# wget https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz
https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz: HTTPS support not compiled in.
root@OpenWrt1:~# uclient-fetch https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz
Downloading 'https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz'
Connecting to 168.119.138.211:443
Writing to 'Packages.gz'
Cannot open output file: File exists

You apparently have wget-nossl instead of wget-ssl installed.

I had a look in the root directory and 'Packages.gz' file exists dated 15th October so I deleted the file and then re-ran the original command which then downloaded the file correctly. I assume I need to unpack/install this file before attempting to download each of the others?

If so could you guide me on the next steps please? Thx

root@OpenWrt1:~# ls -al
drwxr-xr-x    1 root     root           672 Nov 27 14:17 .
drwxr-xr-x    1 root     root           544 Nov 11 18:54 ..
-rw-r--r--    1 root     root         89925 Oct 15 13:52 Packages.gz
-rw-r--r--    1 root     root         67564 Nov 27 09:48 logread_with_errors
-rw-------    1 root     root            45 Nov 19 15:44 wgclient.key
-rw-------    1 root     root            45 Nov 19 15:44 wgclient.psk
-rw-------    1 root     root            45 Nov 19 15:44 wgclient.pub
-rw-------    1 root     root            45 Nov 19 15:44 wgserver.key
-rw-------    1 root     root            45 Nov 19 15:44 wgserver.pub
root@OpenWrt1:~#
root@OpenWrt1:~#
root@OpenWrt1:~# rm Packages.gz
root@OpenWrt1:~# uclient-fetch https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz
Downloading 'https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/packages/Packages.gz'
Connecting to 168.119.138.211:443
Writing to 'Packages.gz'
Packages.gz          100% |*******************************| 89925   0:00:00 ETA
Download completed (89925 bytes)
root@OpenWrt1:~# ls -al
drwxr-xr-x    1 root     root           672 Nov 27 17:34 .
drwxr-xr-x    1 root     root           544 Nov 11 18:54 ..
-rw-r--r--    1 root     root         89925 Nov 27 17:34 Packages.gz
-rw-r--r--    1 root     root         67564 Nov 27 09:48 logread_with_errors
-rw-------    1 root     root            45 Nov 19 15:44 wgclient.key
-rw-------    1 root     root            45 Nov 19 15:44 wgclient.psk
-rw-------    1 root     root            45 Nov 19 15:44 wgclient.pub
-rw-------    1 root     root            45 Nov 19 15:44 wgserver.key
-rw-------    1 root     root            45 Nov 19 15:44 wgserver.pub

yes....I'll have to install the ssl version once I get this sorted, thx

You could manually download wget-ssl .ipk to your PC, transfer the .ipk file with scp to the router, and opkg install it manually.

Thx, the uclient-fetch seems to be at least downloading the files, I'll sort the wget-ssl out later once I get the update working properly.

Are you thinking that having wget-ssl installed will sort out the primary problem of the OPKG update failing?

Given that I've not installed this package before and I'm pretty sure the update has worked previously I'm thinking the problem is likely to be something else? At least the network and DNS seems to be working.

OpenWrt package downloads are now https, while they used to be http.

Not sure about your config, or previous versions that you have used, but wget clearly fails to download with HTTPS.

It is possible that you have earlier had just the default uclient-fetch installed and no wget at all, (and uclient-fetch acts as a small wget replacement if there is no real wget). Now some new package of yours has installed wget as a dependency and the nossl variant has been installed. Something like that.

Thanks for your help :+1: I think you are right about only previously having 'uclient-fetch' installed and that seemed to work perfectly.

I believe the culprit here is 'wget-nossl'. I think what has happened is that after I installed wireguard and DDNS I have also installed 'wget-nossl', mainly because 'wget' was referenced on the DDNS status page as possibly being required to bind to specific interfaces (although it never specified ssl or nossl).

Consequently I installed 'wget-nossl'. I've realised that 'wget-nossl' was symbolically linked to 'wget' in the /usr/bin/ directory. So from that point on whenever I was trying to do a opkg update it was in effect calling wget-nossl and hence failing.

As soon as I removed 'wget-nossl' and and installed 'wget-ssl' everything worked perfectly. There's now a symbolic link created from 'wget-ssl' to 'wget'.

'wget' now works for both http and https.

Right I can get back to trying to sort out my firewall stuff :grinning:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.