OpenWrt Forum Archive

Topic: near brick - opkg not found

The content of this topic has been archived on 5 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello everybody,

I think I just semi-bricked my DLink DIR-505 A1.

I moved to a new apt and brought this router along, with the old config. As the connection in the new apt was really poor, I thought it could be a good idea to update/upgrade the packages, before I tweaked the configs.

I started with the opkg, but it failed. I forgot to save the error messages, but now, when I try to open opkg, it returns:

-ash: opkg: not found

I navigated to /bin and it was there, though I can't run it from there either.

http://i.imgur.com/C8pOcSJ.jpg

I've tried then to update the firmware, but, because the device's storage is so small, I can't get the .bin file to fit so I can convert it to the .trx format (the device have less than 2MB and the firmware have 7.5MB - I also think this is why the opkg failed, but it's just a hypothesis)


What can I do in this situation?



Thanks in regards.

I don't think I understood your answer...
I already know how to strip the header of an firmware .bin file. The problem is that my storage can't hold it, probably because the opkg upgrade failed.

I know there's is a script that removes all the trunk caused by an failed install, BUT the failed package was the opkg itself,  rendering the entire process useless.

All I want is to fix the opkg, that doesn't run at all, as said in the beggining of my first post.

Thanks again.

Is the distro SuperWrt (Romanian)?  If this is correct, be so kind to post support requests to that forum.

Well, "firstboot" command should reset the router to the plain flashed firmware without later modifications. All settings and installed package should get removed.

Alternatively, download the new firmware image to the ramdisk /tmp and use "sysupgrade -n" command to flash the new firmware without preserving settings.

@hnyman Do not ass-u-me the distro contains firstboot.

Max Hopper wrote:

Is the distro SuperWrt (Romanian)?  If this is correct, be so kind to post support requests to that forum.

I thought of that, but since the main difference of the build is actually the presence of Luci, I saw no point going there. But thanks for the tip.

hnyman wrote:

Well, "firstboot" command should reset the router to the plain flashed firmware without later modifications. All settings and installed package should get removed.

Alternatively, download the new firmware image to the ramdisk /tmp and use "sysupgrade -n" command to flash the new firmware without preserving settings.

firstboot failed, but downloading the firmware to ramdisk actually worked. What seems strange, because I thought I hadn't enough space there, but I tried it anyways. Luckily, it booted normally, fresh and clean!

Thank you!

The discussion might have continued from here.