# 搭建主机环境

为编译和安装操作准备主机。

**前提条件：**

> 
> 
> 确保 Ubuntu 22.04 主机符合[主机要求](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-254/github_workflow_unregistered_users.html#host-machine-requirements)，机器人 SDK 需要额外的 50 GB 磁盘空间。

**步骤：**

1. 按照 [Ubuntu 主机设置](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-254/github_workflow_unregistered_users.html#build-with-standalone-commands) 中所述完成以下任务

    1. 安装依赖软件包。
    2. 搭建本地环境。
    3. 更新 git 配置。
2. 将 `/bin/sh` 符号链接更改为默认指向 `bash`。

sudo ln -sf /bin/bash /bin/sh
        Copy to clipboard
3. 按照 [Qualcomm manifest](https://github.com/qualcomm-linux/qcom-manifest/tree/qcom-linux-scarthgap) 页面上的 Install the repo utility 步骤下载 Repo 工具。
4. 安装 libgtest-dev 包。

sudo apt install libgtest-dev
        Copy to clipboard

Note

关于虚拟机 (VM) 编译支持，请参阅 [Qualcomm Linux 虚拟机搭建指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-41/)。

Last Published: May 12, 2025

[Previous Topic
编译和安装](https://docs.qualcomm.com/bundle/publicresource/80-70018-265Y/topics/advanced-usage.md) [Next Topic
编译软件](https://docs.qualcomm.com/bundle/publicresource/80-70018-265Y/topics/build-the-software_4_1.md)