Команда opkg install завершилась с кодом ошибки 255

OpenWrt Forum

Loading

Thanks @hnyman. The patch submission procedure to opkg is not as fluid as it is for github projects. Also, there’s not a clear CONTRIBUTING procedure in https://git.lede-project.org/?p=project/opkg-lede.git, so I’ll just post some patches below, and hopefully @jow- will see them. The fork appears to be based off opkg-0.2.x branch instead of master of http://git.yoctoproject.org/git/opkg, and the fork contains the same PATH handling issue when PATH is not set in the environment.

From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Thu, 2 Mar 2017 16:20:27 -0500
Subject: [opkg-0.2.x PATCH] libopkg/opkg_cmd.c: more robust PATH handling
To: opkg-devel@googlegroups.com

preserve semantics of PATH when PATH is not set in environment

error and undefined behavior reported in
  https://github.com/openwrt/packages/issues/1922
when PATH not set in environment
(lighttpd executes CGI with empty base env, plus standard CGI env vars)

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
 libopkg/opkg_cmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
index 567dfb1..6bdb7d9 100644
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
@@ -257,11 +257,13 @@ static opkg_intercept_t
 opkg_prep_intercepts(void)
 {
     opkg_intercept_t ctx;
+    const char *oldpath;
     char *newpath;
 
     ctx = xcalloc(1, sizeof (*ctx));
     ctx->oldpath = xstrdup(getenv("PATH"));
-    sprintf_alloc(&newpath, "%s/opkg/intercept:%s", DATADIR, ctx->oldpath);
+    oldpath = ctx->oldpath ? ctx->oldpath : "/usr/sbin:/usr/bin:/sbin:/bin";
+    sprintf_alloc(&newpath, "%s/opkg/intercept:%s", DATADIR, oldpath);
     sprintf_alloc(&ctx->statedir, "%s/opkg-intercept-XXXXXX", conf->tmp_dir);
 
     if (mkdtemp(ctx->statedir) == NULL) {
@@ -286,7 +288,10 @@ opkg_finalize_intercepts(opkg_intercept_t ctx)
     DIR *dir;
     int err = 0;
 
-    setenv ("PATH", ctx->oldpath, 1);
+    if (ctx->oldpath)
+        setenv("PATH", ctx->oldpath, 1);
+    else
+        unsetenv("PATH");
     free (ctx->oldpath);
 
     dir = opendir (ctx->statedir);
-- 
2.9.3

From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Thu, 2 Mar 2017 03:18:30 -0500
Subject: [opkg-0.2.x PATCH] libopkg: specify "/bin/sh" instead of "sh"
To: opkg-devel@googlegroups.com

avoid strange behavior with execvp() when PATH is not set in environment
(in which case confstr(_CS_PATH) should return something reasonable)

reproducable running openwrt 15.05 and 15.05.1 and attempting to install
a software package (e.g. libuuid) via LuCI (prior to openwrt/luci#1048).
(https://github.com/openwrt/luci/pull/1048) libuuid.postinst fails with
status 255 on 15.05 and opkg segfaults in 15.05.1.  This probably merits
further exploration.

Originally reported in https://github.com/openwrt/packages/issues/1922

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
 libopkg/opkg_cmd.c | 2 +-
 libopkg/pkg.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
index 567dfb1..d9b8762 100644
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
@@ -300,7 +300,7 @@ opkg_finalize_intercepts(opkg_intercept_t ctx)
 
 	    sprintf_alloc (&path, "%s/%s", ctx->statedir, de->d_name);
 	    if (access (path, X_OK) == 0) {
-		const char *argv[] = {"sh", "-c", path, NULL};
+		const char *argv[] = {"/bin/sh", "-c", path, NULL};
 		xsystem (argv);
 	    }
 	    free (path);
diff --git a/libopkg/pkg.c b/libopkg/pkg.c
index 7c0cf99..d471d19 100644
--- a/libopkg/pkg.c
+++ b/libopkg/pkg.c
@@ -1297,7 +1297,7 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
      sprintf_alloc(&cmd, "%s %s", path, args);
      free(path);
      {
-	  const char *argv[] = {"sh", "-c", cmd, NULL};
+	  const char *argv[] = {"/bin/sh", "-c", cmd, NULL};
 	  err = xsystem(argv);
      }
      free(cmd);
-- 
2.9.3

Failed to update openwrt keyring file, conflict between base version and package version? Error 255?

Details for package openwrt-keyring

Version: 2021-02-20-49283916-2
Size: ~393 B installed

Description

The keyring of with the developer using and gpg public keys.

Require approx. 393 B size for 1 package(s) to install.

Executing package manager

Upgrading openwrt-keyring on root from 2019-07-25-8080ef34-1 to 2021-02-20-49283916-2…
Downloading http://downloads.openwrt.org/releases/19.07.7/packages/arm_xscale/base/openwrt-keyring_2021-02-20-49283916-2_arm_xscale.ipk

Errors

Collected errors:

  • check_data_file_clashes: Package openwrt-keyring wants to install file /etc/opkg/keys/f94b9dd6febac963
    But that file is already provided by package * base-files
  • opkg_install_cmd: Cannot install package openwrt-keyring.

The opkg install command failed with code 255.

Any ideas how to resolve this issue?

Drno, Неа, на роутере никаких впн клиентов, пакеты я попробовал скачать с офицального репо и установить их на роутере но даёт ошибку

Запуск менеджера пакетов
Unknown package 'openvpn-openssl'.
Ошибки
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency kmod-tun for openvpn-openssl
 * pkg_hash_check_unresolved: cannot find dependency liblzo2 for openvpn-openssl
 * pkg_hash_fetch_best_installation_candidate: Packages for openvpn-openssl found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package openvpn-openssl.
Команда opkg install завершилась с кодом ошибки 255.

Issue template:

Steps to reproduce:

  1. Install openwrt-21.02 branch (git-22.046.85957-59c3392) / OpenWrt 21.02.2 r16495-bf0c965af0
  2. Go to «System->Software» menu, or use opkg directly
  3. Install luci-app-cshark

Problem:
The install fails with this message:

Executing package manager

Installing luci-app-cshark (git-20.110.55046-74da73b) to root...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/arm_cortex-a9_vfpv3-d16/luci/luci-app-cshark_git-20.110.55046-74da73b_all.ipk
Installing libpcap1 (1.9.1-3.1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/arm_cortex-a9_vfpv3-d16/base/libpcap1_1.9.1-3.1_arm_cortex-a9_vfpv3-d16.ipk
Installing libmbedtls12 (2.16.12-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/arm_cortex-a9_vfpv3-d16/base/libmbedtls12_2.16.12-1_arm_cortex-a9_vfpv3-d16.ipk
Installing libustream-mbedtls20201210 (2022-01-16-868fd881-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/arm_cortex-a9_vfpv3-d16/base/libustream-mbedtls20201210_2022-01-16-868fd881-1_arm_cortex-a9_vfpv3-d16.ipk
Configuring libmbedtls12.
Configuring libpcap1.

Errors

Collected errors:
 * check_data_file_clashes: Package libustream-mbedtls20201210 wants to install file /lib/libustream-ssl.so
	But that file is already provided by package  * libustream-wolfssl20201210
 * opkg_install_cmd: Cannot install package luci-app-cshark.

The opkg install command failed with code 255.

Actual behavior:

Software package fails to install.

Expected behavior:

Software package installs.

Возможно, вам также будет интересно:

  • Команда cmd для проверки системы на ошибки
  • Команда chkdsk для исправления ошибок
  • Команда auth tls ошибка невозможно подключиться к серверу
  • Ком не запускается выдает ошибку
  • Ком гугл процесс гапс произошла ошибка что делать

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии