openwrt安装passwall报错pkg_hash_check_unresolved: cannot find dependency dns2socks for luci-app-passwall的解决办法

报错如下:

Unknown package 'luci-app-passwall'.
Installing luci-i18n-passwall-zh-cn (26.8.19) to root…
Collected errors:

  • pkg_hash_check_unresolved: cannot find dependency dns2socks for luci-app-passwall
  • pkg_hash_fetch_best_installation_candidate: Packages for luci-app-passwall found, but incompatible with the architectures configured
  • opkg_install_cmd: Cannot install package luci-app-passwall.
  • satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-i18n-passwall-zh-cn:
  • dns2socks
  • opkg_install_cmd: Cannot install package luci-i18n-passwall-zh-cn.
    [ERROR] PassWall 安装失败。

解决方案:

使用opkg安装dns2socks也会报错

Unknown package 'dns2socks'.
Collected errors:

  • opkg_install_cmd: Cannot install package dns2socks.
    root@iStoreOS:~# opkg install dns2socks
    Unknown package 'dns2socks'.
    Collected errors:
  • opkg_install_cmd: Cannot install package dns2socks.

最新版的openwrt已经没有这个包了,我们需要手动去编译

以下代码直接运行就行


cd /tmp
# 1. 自动检测你的 CPU 架构
arch=$(opkg print-architecture | grep -oE 'x86_64|aarch64_generic' | head -n 1)

# 2. 根据架构下载对应的 dns2socks 离线包
if [ "$arch" == "x86_64" ]; then
  echo "检测到 x86_64 架构,正在下载..."
  wget -O dns2socks.ipk "https://downloads.sourceforge.net/project/openwrt-passwall-build/releases/packages-23.05/x86_64/passwall_packages/dns2socks_2.1-2_x86_64.ipk"
elif [ "$arch" == "aarch64_generic" ]; then
  echo "检测到 ARM (aarch64) 架构,正在下载..."
  wget -O dns2socks.ipk "https://downloads.sourceforge.net/project/openwrt-passwall-build/releases/packages-23.05/aarch64_generic/passwall_packages/dns2socks_2.1-2_aarch64_generic.ipk"
else
  echo "抱歉,暂未匹配到对应的架构。"
fi

# 3. 强制忽略系统内核版本校验进行安装
if [ -f "/tmp/dns2socks.ipk" ]; then
  echo "下载完成,开始强制安装..."
  opkg install /tmp/dns2socks.ipk --force-depends
  rm /tmp/dns2socks.ipk
else
  echo "下载失败,请检查路由器的网络是否能访问外网。"
fi

然后再去安装passwall就可以了

发表回复

后才能评论