Linux crossbuild必备armhf破包

Linux crossbuild必备armhf破包

我正在尝试在我的 Raspberry Pi Linux 内核上安装和设置 Linux 内核。我参考了以下网站:https://www.raspberrypi.com/documentation/computers/linux_kernel.html

到目前为止,我已按以下顺序在树莓派上运行以下命令:

  1. 须藤apt更新
  2. sudo apt 升级
  3. sudo apt-get 自动删除
  4. sudo apt install git bc bison flex libssl-dev make
  5. git 克隆 --深度=1https://github.com/raspberrypi/linux
  6. cd linux KERNEL=kernel7 make bcm2709_defconfig
  7. make -j4 zImage 模块 dtbs
  8. 须藤使模块_安装
  9. sudo cp arch/arm/boot/dts/*.dtb /boot/
  10. sudo cp arch/arm/boot/dts/overlays/.dtb/启动/覆盖/
  11. sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
  12. sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
  13. sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev
  14. sudo apt install crossbuild-essential-armhf

然而,在第14点执行命令时,我遇到了以下错误。

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 crossbuild-essential-armhf : Depends: gcc-arm-linux-gnueabihf (>= 5.3) but it is not going to be installed
                              Depends: g++-arm-linux-gnueabihf (>= 5.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

答案1

尝试安装表示不会安装的依赖项。例如:

sudo apt install gcc-arm-linux-gnueabihf

最终 apt 会说类似“取决于:[package] 无法安装”之类的内容

答案2

您使用的树莓派操作系统是什么版本?也许您可以通过使用较新的树莓操作系统版本来避免这些问题。

无论如何,我首先会尝试:

sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
sudo apt-get install g++-arm-linux-gnueabihf
sudo apt --fix-broken install

相关内容