天天看點

IOT2050 (Debian11)安裝 Azure IoT Edge RuntimeAuthor

< Jiang Jia Hao > [email protected]

文章目錄

    • 建立工作目錄
    • 配置環境
    • 安裝容器引擎
    • 擷取 aziot-edge 和 aziot-identity-service 安裝包
    • 安裝 Azure IoT Edge
    • 解除安裝 Azure IoT Edge
        • 清理安裝檔案
  • Author

建立工作目錄

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 > [email protected]

繼續閱讀