当前位置:   article > 正文

dpkg: error package architecture (amd64) does not match system (arm64)

package architecture (amd64) does not match system (arm64)

dpkg: error package architecture (amd64) does not match system (arm64)

dpkg安装deb的时候报错,

# dpkg -i hello-2212-linux-amd64.deb
dpkg: error processing archive hello-2212-linux-amd64.deb (--install):
 package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
 hello-2212-linux-amd64.deb
  • 1
  • 2
  • 3
  • 4
  • 5

原因是打包机器的的architecture (amd64) 和 安装的 机器architecture (arm64)不同所致
解决方案是:打包的时候,指定 architecture

cat package/DEBIAN/control
Package: hello
Version: 2212
Section: Software
Priority: optional
Depends:
Architecture: arm64
maintainer: 
description: 

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

其中 package 是要打包的目录

重新打包

VERSION=2212
PKG_NAME="hello-$VERSION-linux-arm64.deb"
dpkg -b package/ $PKG_NAME
  • 1
  • 2
  • 3

重新安装

# dpkg -i hello-2212-linux-arm64.deb
(Reading database ... 34268 files and directories currently installed.)
Preparing to unpack hello-2212-linux-arm64.deb ...
Unpacking hccbagent (2212) over (2212) ...
Setting up hccbagent (2212) ...

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

安装成功

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号