Opkg update error- wget returned 8

i am getting opkg update error. anyone can guide me what is wrong

root@OpenWrt:~# update-ca-certificates
-ash: update-ca-certificates: not found
root@OpenWrt:~# rm /etc/opkg.conf && cp /rom/etc/opkg.conf /etc/opkg.conf && opk
g update
Downloading https://downloads.openwrt.org/snapshots/targets/qualcommax/ipq807x/p            ackages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/snaps            hots/targets/qualcommax/ipq807x/packages/Packages.gz

Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/            base/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/snaps            hots/packages/aarch64_cortex-a53/base/Packages.gz

Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/            luci/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/snaps            hots/packages/aarch64_cortex-a53/luci/Packages.gz

Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/            packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/snaps            hots/packages/aarch64_cortex-a53/packages/Packages.gz

Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/            routing/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/snaps            hots/packages/aarch64_cortex-a53/routing/Packages.gz

Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/            telephony/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/snaps            hots/packages/aarch64_cortex-a53/telephony/Packages.gz

Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/snapshots/tar            gets/qualcommax/ipq807x/packages/Packages.gz, wget returned 8.
 * opkg_download: Failed to download https://downloads.openwrt.org/snapshots/pac            kages/aarch64_cortex-a53/base/Packages.gz, wget returned 8.
 * opkg_download: Failed to download https://downloads.openwrt.org/snapshots/pac            kages/aarch64_cortex-a53/luci/Packages.gz, wget returned 8.
 * opkg_download: Failed to download https://downloads.openwrt.org/snapshots/pac            kages/aarch64_cortex-a53/packages/Packages.gz, wget returned 8.
 * opkg_download: Failed to download https://downloads.openwrt.org/snapshots/pac            kages/aarch64_cortex-a53/routing/Packages.gz, wget returned 8.
 * opkg_download: Failed to download https://downloads.openwrt.org/snapshots/pac            kages/aarch64_cortex-a53/telephony/Packages.gz, wget returned 8.
root@OpenWrt:~# wget https://downloads.openwrt.org/snapshots/packages/aarch64_co
rtex-a53/routing/ -O /var/lib/opkg/packages/routing/
Downloading 'https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53            /routing/'
Connecting to 2a04:4e42:8f::644:443
Writing to '/var/lib/opkg/packages/routing/'
Cannot open output file: No such file or directory
root@OpenWrt:~# wget https://downloads.openwrt.org/snapshots/packages/aarch64_co
rtex-a53/telephony/Packages.gz -O /var/lib/opkg/packages/telephony/Packages.gz
Downloading 'https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53            /telephony/Packages.gz'
Connecting to 2a04:4e42:8f::644:443
HTTP error 404

Return code 8 -> server returned an error

What is in

nslookup downloads.openwrt.org
ubus call system board
ping -c3 1.0.0.1

Let’s also see the output of

date

snapshots switched package manager from opkg to apk https://github.com/openwrt/openwrt/commit/40b8fbaa9754c86480eefc3692c9116a51a64718, so you need to perform full sysupgrade of the underlying system to latest snapshot version using apk as package manager. See The future is now: opkg vs apk - #25 by hnyman for more details.

1 Like

If you are using SNAPSHOT version of openwrt then you have to use apk, try:

apk update
apk add <package_name>

wget returns 404 because in the snapshot directory there are only .apk files and there is packages.adb not packages.gz

I think you had installed snapshot before apk was implemented or there was really opkg in that version of snapshot. In this case SYSUPGRADE the new snapshot and then run apk. That will be solved.

Or if you want to really use opkg which may be available for some time, try to install the latest stable openwrt version like 23.05.5. There you will find opkg as package manager.

Note: you should keep backup before sysupgrade

1 Like

I have the exact same issue on a number of devices.

Not because I ever used snapshot, but because I used Attended Sysupgrade via LUCI to upgrade the boxes.

I thought it was the recommended approach at the time so did it everywhere. :wink:

Now they're all unable to update lists, install an opkg etc.

SNAPSHOTS go "bad" after a few days. Meaning the easiest way to get it working again is to build a new SNAPSHOT and flash it.

This does not happen with stable releases.

1 Like

I wonder why unattended-sysupgrade via luci switches the box to run snapshot.

Maybe I didn't read the docs properly...