Opkg: Failed to download

Router: Linksys WRT1900AC v2
Firmware: OpenWrt 18.06.0-rc2
DHCP and Firewall were disabled via GUI. Running in bridge mode with wireless active. The clients can access the internet fine, and I can ping 8.8.8.8 successfully via SSH. Can someone point out what is wrong please?

Downloading http://downloads.openwrt.org/releases/18.06.0-rc2/targets/mvebu/cortexa9/packages/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/releases/18.06.0-rc2/targets/mvebu/cortexa9/packages/Packages.gz

/etc/config/dhcp

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'

config dhcp 'lan'
option interface 'lan'
option ignore '1'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'

/etc/config/

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd3c:b85e:427b::/48'

config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.1.3'

config interface 'wan'
option ifname 'eth1.2'
option proto 'dhcp'

config interface 'wan6'
option ifname 'eth1.2'
option proto 'dhcpv6'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 1 2 3 5t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '4 6t'

1 Like

Yes but can you ping "google.com"

Every time I want to run opkg update I run this command in SSH first, In my case it's a DNS issue.

This command is overwritten when you reboot the device.

echo "nameserver 8.8.8.8" | tee -a /etc/resolv.conf
2 Likes

You are right.

root@OpenWrt:/etc/config# echo "nameserver 8.8.8.8" | tee -a /etc/resolv.conf
nameserver 8.8.8.8
root@OpenWrt:/etc/config# opkg update
Collected errors:

  • opkg_conf_load: Could not lock /var/lock/opkg.lock: Resource temporarily unavailable.

new error now.

I would poweroff the router for a few seconds then reboot.

After reboot run the command again before trying anything else

1 Like

Ok, I think having the GUI at the Software page and having SSH active was the issue. It works when I close either one.

Thanks for you help. Is there no way to keep that cmd permanent?
echo "nameserver 8.8.8.8" | tee -a /etc/resolv.conf

There probably is, but for me I don't really care if it knows how to get to the internet -- As long as it lets my devices get there I'm happy

1 Like

very good point indeed... lol

Thanks again!

I looked threw some of my note's and found this command and I think it persists after reboot

uci set network.lan.dns=8.8.8.8
uci commit network
reboot

You may have to find the name of your Wan though. Also you could change the DNS server to something closer to you EG: 1.1.1.1

But like I said " it works and I don't care"

1 Like

I should show the way I upgrade Openwrt/Lede

Check this guy's site: It also works on 18.01.0

echo "nameserver 8.8.8.8" | tee -a /etc/resolv.conf

opkg update && opkg install curl

curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh -o ./opkg-upgrade.sh && chmod +x ./opkg-upgrade.sh && ./opkg-upgrade.sh

1 Like

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