openwrt安装ipk报错“incompatible with the architectures configured”

在高通平台上安装ipk的时候报了下面的错:

Unknown package 'php7-mod-sqlite3'.
Collected errors:
 * pkg_hash_fetch_best_installation_candidate: Packages for php7-mod-sqlite3 found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package php7-mod-sqlite3.

显然是架构不对,看了一眼9533的cpuinfo

cat /proc/cpuinfo 
system type             : Qualcomm Atheros QCA9533 ver 2 rev 0
machine                 : xxxxx
processor               : 0
cpu model               : MIPS 24Kc V7.4
BogoMIPS                : 432.53
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

原来是MIPS 24Kc,ipk的包用错了php7-mod-sqlite3_7.2.16-1_mipsel_24kc.ipk,应该使用php7-mod-sqlite3_7.2.16-1_mip_24kc.ipk。妹的,尴尬。

<think>嗯,用户遇到了在使用opkg安装fdisk包时出现架构不兼容的问题。首先,我需要回想一下OpenWrt的包管理机制。opkg在安装包时会检查包的架构是否与系统配置的架构匹配。如果出现不兼容,通常是因为包是为不同的CPU架构编译的,比如系统是armv7而包是x86的。 接下来,用户可能需要确认系统的架构。通过运行`opkg print-architecture`可以查看支持的架构列表。然后,检查下载的fdisk包的架构是否正确。如果包的架构与系统不匹配,用户需要找到对应架构的包源,或者自行编译。 另外,有时候官方源可能没有对应的包,这时候需要添加第三方源。用户需要确保第三方源的URL正确,并且包含适合自己设备的包。如果官方源确实没有,可能需要编译安装,或者使用Entware这样的替代方案。 需要注意的是,强制安装不兼容的包可能会导致系统不稳定,所以最好还是找到正确架构的包。如果用户自行编译,确保交叉编译工具链配置正确,避免出现依赖问题。 最后,建议用户检查包的依赖是否满足,有时候依赖项缺失也会导致安装失败。可以使用`opkg info`查看包的具体信息,确认所有依赖都已安装。</think>要解决`fdisk`包与OpenWrt系统架构不兼容的问题,请按照以下步骤操作: ### 1. 确认系统架构 通过SSH登录设备后执行: ```bash opkg print-architecture ``` 输出示例: ``` arch all 1 arch noarch 1 arch mipsel_24kc 10 ``` 此处`mipsel_24kc`是当前系统的架构标识[^1] ### 2. 检查包架构 查看`.ipk`包文件名的架构标识: ``` fdisk_2.36.1-1_mips_24kc.ipk ^^^^^^^^ ``` 需确保此处的架构标识与步骤1的输出完全匹配 ### 3. 解决方案 #### (1) 更换软件源 编辑`/etc/opkg.conf`文件: ```bash vi /etc/opkg.conf ``` 添加匹配架构的软件源(示例为mips_24kc): ``` src/gz base https://downloads.openwrt.org/releases/21.02.1/packages/mips_24kc/base ``` #### (2) 强制安装(慎用) ```bash opkg install --force-depends --force-overwrite fdisk_*.ipk ``` ⚠️ 注意:可能引发系统不稳定 #### (3) 交叉编译 下载OpenWrt SDK后执行: ```bash make package/utils/fdisk/compile ``` 生成的ipk文件路径: ``` bin/packages/<arch>/base/fdisk_*.ipk ``` ### 4. 替代方案 安装Entware扩展仓库: ```bash wget -O - http://bin.entware.net/mipselsf-k3.4/installer/generic.sh | /bin/sh opkg install fdisk-udisks ```
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值