"opkg install package" fails

Hello everyone,

I am using "21.02.1, r16325-88151b8303" stable release on a Yun without any problems except when trying to install "gcc" package from "opkg".I tried downloading the package with "wget" and installing the offline package and the process automatically returns to downloading the package again then eventually ends up at the same result.

root@OpenWrt:~# opkg install gcc
Installing gcc (7.4.0-5) to root...
Downloading https://downloads.openwrt.org/releases/21.02.1/packages/mips_24kc/packages/gcc_7.4.0-5_mips_24kc.ipk
Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/21.02.1/packages/mips_24kc/packages/gcc_7.4.0-5_mips_24kc.ipk, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_install_pkg: Failed to download gcc. Perhaps you need to run 'opkg update'?
 * opkg_install_cmd: Cannot install package gcc.

Only this package rises this error, not others. Any idea what might be causing this ?

Thank you!

Did you run opkg update first?

Yes I ran opkg update before opkg install gcc

and if you try to wget https://downloads.openwrt.org/releases/21.02.1/packages/mips_24kc/packages/gcc_7.4.0-5_mips_24kc.ipk

I can get it the package that way without any issues. But can not install it afterwards, same situation occurs

the error's the same ? does the file size check out after DLing ?
Package's pretty big - 30MB, does it fit your flash ?

-rw-r--r-- 1 root root 30.1M Dec 7 16:14 gcc_7.4.0-5_mips_24kc.ipk

1 Like

Package downloads without issues,

opkg install gcc_7.4.0-5_mips_24kc.ipk

tries to download the file again

opkg install should try to DL it again, unless something's wrong.

try opkg install ./gcc_7.4.0-5_mips_24kc.ipk

opkg install ./gcc_7.4.0-5_mips_24kc.ipk -d sd

is trying to download the package again also

What is this?

installing the package to sd card

Don't you need the path?

I thought the -d argument:

        -d <dest_name>          Use <dest_name> as the the root directory for
        --dest <dest_name>      package installation, removal, upgrading.
                                <dest_name> should be a defined dest name from
                                the configuration file, (but can also be a
                                directory name in a pinch).

I guess sd is in that file?

Also see -o:

        -o <dir>                Use <dir> as the root directory for
        --offline-root <dir>    offline installation of packages.

It seems you need -o instead (I may be wrong), as it seems -d obtains the file from the online repository.

The path already exists in the /etc/opkg.conf so that I can call it by it's name

1 Like

try -o instead of -d

1 Like


* opkg_install_cmd: Cannot install package gcc.


Did you specificity the location of the downloaded file?

root@OpenWrt:/overlay# opkg install gcc_7.4.0-5_mips_24kc.ipk --offline-root /overlay
Collected errors:

  • opkg_conf_load: Could not create lock file /overlay//var/lock/opkg.lock: No such file or directory.

double slash, usually not a problem though.

Yes but I do not provide it, opkg_conf_load gets it automatically that way

  • You cannot install here (this is the unmodified section)
  • I thought you wanted install on the SD card???