1. 问题背景
PetaLinux是FPGA+AI开发板厂商Xilinx定制的Linux系统,可以安装在开发板的PS端,然后执行AI任务。
想在开发板以外的地方使用PetaLinux,需要在Ubuntu上安装。
这里我使用的是Ubuntu24.04,安装PetaLinux2021.1。
2. 报错信息
gzr@gzr-Legion-Y9000P-IAH7H:~/文档$ ./petalinux-v2021.1-final-installer.run -d /opt/pkg/petalinux/
INFO: Checking installation environment requirements...
WARNING: This is not a supported OS
INFO: Checking free disk space
INFO: Checking installed tools
INFO: Checking installed development libraries
ERROR: You are missing these development libraries required by PetaLinux:
- zlib1g:i386
Please install them with your operating system package manager, and try again
WARNING: Please install required packages.
Please refer to the PetaLinux Tools Installation Guide.
Check the troubleshooting guide at the end of that manual, and if you are
unable to resolve the issue please contact customer support with file:
/home/gzr/文档/petalinux_installation_log
然后参考:https://blog.csdn.net/whoareyouzjr/article/details/142736041
我做了以下操作:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt upgrade
sudo apt-get install zlib1g:i386
可是无效,PetaLinux仍然找不到包。
3. 问题解决
参考:https://adaptivesupport.amd.com/s/question/0D54U00008ShJduSAF/error-you-are-missing-these-development-libraries-zlib1gi386-even-though-is-installed?language=en_US
问题来源于PetaLinux依赖zlib1g的特定版本,需要降级,那么下载这个包的过去版本:
- zlib1g-1.2.13:amd64 https://packages.debian.org/bookworm/amd64/zlib1g/download
- zlib1g-1.2.13:i386 https://packages.debian.org/bookworm/i386/zlib1g/download
- zlib1g-dev-1.2.13:i386 https://packages.debian.org/bookworm/i386/zlib1g-dev/download
然后执行:
# Remove existing installations for zlib1g-dev-1.3
sudo apt remove zlib1g-dev:i386
sudo apt remove zlib1g-dev
# Install the zlib1g-dev-1.2.1.3
sudo dpkg -i zlib1g_1.2.13.dfsg-1_amd64.deb
sudo dpkg -i zlib1g_1.2.13.dfsg-1_i386.deb
sudo dpkg -i zlib1g-dev_1.2.13.dfsg-1_i386.deb