IOT2050 (Debian11)安装 Azure IoT Edge Runtime

韶和璧
2023-12-01

< Jiang Jia Hao > jiahao.jiang@scapeak.com

创建工作目录

cd /home
mkdir work && chmod -R 777 work
cd work

配置环境

#设备上设置微软的存储库
curl https://packages.microsoft.com/config/debian/11/prod.list > $(pwd)/microsoft-prod.list
cp $(pwd)/microsoft-prod.list /etc/apt/sources.list.d/

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > $(pwd)/microsoft.gpg
cp $(pwd)/microsoft.gpg /etc/apt/trusted.gpg.d/

注:若在执行第三步命令出现:-bash: gpg: command not found错误,请先安装 gpg 命令。gpg 命令用于签名、加密和验证数据。

你需要在系统中使用 gpg 命令,可以按照以下步骤安装:

sudo apt-get update
sudo apt-get install gnupg

安装容器引擎

sudo apt-get update
sudo apt-get update --fix-missing
apt-get -y install moby-engine moby-cli

获取 aziot-edge 和 aziot-identity-service 安装包

wget https://github.com/Azure/azure-iotedge/releases/download/1.4.2/aziot-edge_1.4.2-1_debian11_arm64.deb
wget https://github.com/Azure/azure-iotedge/releases/download/1.4.2/aziot-identity-service_1.4.1-1_debian11_arm64.deb

安装 Azure IoT Edge

dpkg -i aziot-edge_1.4.2-1_debian11_arm64.deb
dpkg -i aziot-identity-service_1.4.1-1_debian11_arm64.deb

注:若在执行安装命令时出现如下错误,请安装缺失的依赖包

dpkg: dependency problems prevent configuration of aziot-identity-service:
 aziot-identity-service depends on libtss2-esys-3.0.2-0 (>= 2.3.1); however:
  Package libtss2-esys-3.0.2-0 is not installed.
 aziot-identity-service depends on libtss2-mu0 (>= 3.0.1); however:
  Package libtss2-mu0 is not installed.
 aziot-identity-service depends on libtss2-rc0 (>= 3.0.1); however:
  Package libtss2-rc0 is not installed.
 aziot-identity-service depends on libtss2-tctildr0 (>= 3.0.1); however:
  Package libtss2-tctildr0 is not installed.

dpkg: error processing package aziot-identity-service (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 aziot-identity-service

安装缺失的依赖包:

sudo apt-get update
sudo apt-get install libtss2-esys-3.0.2-0 libtss2-mu0 libtss2-rc0 libtss2-tctildr0

配置IoT Edge Device链接字符串

cp /etc/aziot/config.toml.template /etc/aziot/config.toml

# 编辑config.toml文件,打开如下三行注释并修改connection_string为自己设备的连接字符串

[provisioning]
source = "manual"
connection_string = "your-connection-string"

卸载 Azure IoT Edge

如果您需要卸载 Azure IoT Edge,可继续参阅如下步骤

apt-get remove -y --purge aziot-edge
docker rm -f $(docker ps -aq)
apt-get remove -y --purge moby-cli
apt-get remove -y --purge moby-engine

清理安装文件

rm aziot-edge_1.4.2-1_debian11_arm64.deb
rm aziot-identity-service_1.4.1-1_debian11_arm64.deb

Author

< Jiang Jia Hao > jiahao.jiang@scapeak.com

 类似资料: