树莓派Ubuntu20.04系统安装vcgencmd

树莓派使用Ubuntu官方的Ubuntu server 20会导致vcgencmd command not found,按照下面的步骤走即可解决

首先用su命令进入root用户模式下,接着执行

cd /tmp
git clone https://github.com/raspberrypi/userland.git 
cd userland

如果你使用的是32位OS,输入

./buildme

如果是64位OS,则输入

./buildme --aarch64

接着,在/opt/vc/bin目录下就有vcgencmd了。直接运行,可能导致报错:

./vcgencmd: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory

在root用户下执行:

echo "/opt/vc/lib" >> /etc/ld.so.conf
ldconfig

即可。

如果需要,可以将/opt/vc/bin加入到环境变量PATH内。

注一:

出编译时出现

CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!

原因:ubuntu没有自带编译环境

方案:

sudo apt install -y build-essential

参考:

树莓派Ubuntu系统安装vcgencmd - 斐斐のBlog (mmuaa.com)

注二:

运行时出现

VCHI initialization failed

方法

sudo usermod -G video <username>
sudo reboot

然后

sudo vcgencmd XXXXXXXXX

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值