Error on checking dependencies (check-deps VS Code Task) Torizon IDE Extension 2.5.1 on Avalonia .NET 8.0 Frame Buffer DRM project type

torizon@verdin-imx8mp-15229850:~$ sudo tdx-info
Password:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.148-6.6.1+git.23a8e831749d #1-TorizonCore SMP PREEMPT Thu Feb 29 20:25:21 UTC 2024
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/f5f0b9e40c1595ab904ce493a792a0b54e17f0dc3ce6832ddb889452bdd13704/0
Distro name:              NAME="TorizonCore"
Distro version:           VERSION_ID=6.6.1-build.14
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-imx8mp-15229850
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1B
Serial number:            15229850
Processor arch:           aarch64
------------------------------------------------------------
torizon@verdin-imx8mp-15229850:~$
[Hardware Configuration]
Verdin iMX8M Plus Evaluation Kit with Touchscreen
with:
SOM i.MX8M Plus Quad 4GB WB IT v1.1B
Dahlia Carrier Board v1.1D
Verdin DSI to LVDS rev 1.1A
Capacitive Touch Display 10.1" v1.0A

When I open my new project based on the Avalonia .NET 8 Frame Buffer DRM, located in the directory /home/torizon/dev/AvaloniaFrameBufferDRMTest on my WSL2 Torizon OS created by my new Torizon IDE extension 2.5.1, I have the task check-deps which is ran, and there is a problem in my file /etc/os-release.

Checking dependencies ...
👍 openssh-client debian package dependency installed
👍 sshpass debian package dependency installed
😵 .conf/installDepsScripts/installDotnetSDK7.sh dependency installation script not executed before for this project
😵 .conf/installDepsScripts/installDotnetSDK8.sh dependency installation script not executed before for this project
Try to install the missing debian packages and execute the missing installation scripts? <y/N>: y
/etc/os-release: line 4: Environment: command not found

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

--2024-06-26 14:46:23--  https://packages.microsoft.com/config/ubuntu/12/packages-microsoft-prod.deb
Resolving packages.microsoft.com (packages.microsoft.com)... 13.107.246.42, 2620:1ec:bdf::42
Connecting to packages.microsoft.com (packages.microsoft.com)|13.107.246.42|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-06-26 14:46:24 ERROR 404: Not Found.

❌ error trying to execute the dependency installation script .conf/installDepsScripts/installDotnetSDK7.sh

 *  The terminal process "pwsh '-nop', '/home/torizon/dev/AvaloniaFrameBufferDRMTest/.conf/checkDeps.ps1'" terminated with exit code: 69. 
 *  Terminal will be reused by tasks, press any key to close it

The content of my /etc/os-release file is as follow:

🐧 torizon @LAPTOPFRANCOIS/etc: cat /etc/os-release
PRETTY_NAME="Torizon Development Environment for WSL 2"
NAME="TorizonOS"
VERSION=0.0.12
VERSION_CODENAME=Development Environment for WSL 2
ID=torizon
VERSION_ID=0.0.12
VARIANT={{VARIAN}}
HOME_URL="https://www.torizon.io"
SUPPORT_URL="https://community.toradex.com"
BUG_REPORT_URL="https://github.com/commontorizon/cookbook-torizon-wsl/issues"

The content of the file

🐧 torizon @LAPTOPFRANCOIS~/dev/AvaloniaFrameBufferDRMTest/.conf/installDepsScripts: cat installDotnetSDK7.sh
#!/bin/bash
set -e

# This is a script to install .NET on Ubuntu, based on the official Microsoft recommended method of installation:
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

package='dotnet-sdk-7.0'

# Check if we are running on the LTS Ubuntu or Debian
if [ -f /etc/os-release ]; then
    # unset the exit with error
    set +e
    . /etc/os-release
    set -e

    if [ "$ID" = "ubuntu" ]; then
        repo="ubuntu"
        repo_version="24.04"
    elif [ "$ID" = "debian" ]; then
        repo="debian"
        repo_version="12"
    elif [ "$ID" = "torizon" ]; then
        repo="debian"
        repo_version="12"
    else
        echo "🔴 Unsupported distribution"
        echo "Please use the latest LTS of Debian or Ubuntu"
        echo "If you are using WSL 2 check the Torizon OS environment for WSL 2: https://bit.ly/4b2T1hd"
        exit 69
    fi
else
    echo "Unsupported distribution"
    exit 69
fi

# Get the source URL of the dotnet-sdk package installed
source=$(apt policy $package | awk '/ \*/{getline; print $2}')


# Check if the dotnet-sdk installed package comes from the Microsoft source
if [ "$source" != "https://packages.microsoft.com/ubuntu/$repo_version/prod" ]; then

    # Download Microsoft signing key and repository
    wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

    # Install Microsoft signing key and repository
    sudo dpkg -i packages-microsoft-prod.deb

    # Clean up
    rm packages-microsoft-prod.deb

    # Remove the dotnet-sdk installation that doesn't come from the Microsoft source
    sudo apt-get remove --purge $package -y

    sudo apt-get autoremove -y

    # Enforce the preference for the dotnet and aspnet packages comming from the Microsoft source
    if [ ! -f /etc/apt/preferences ] || ! grep -q "Package: dotnet\* aspnet\* netstandard\*" /etc/apt/preferences
    then
        echo "Package: dotnet* aspnet* netstandard*" | sudo tee -a /etc/apt/preferences
        echo "Pin: origin packages.microsoft.com" | sudo tee -a /etc/apt/preferences
        echo "Pin-Priority: 1001" | sudo tee -a /etc/apt/preferences

    fi

fi

# Update packages
sudo apt-get update -y

# Install the dotnet-sdk that come from the Microsoft source
sudo apt-get install $package -y

I have tried to run it manually, but it does the same error:

🐧 torizon @LAPTOPFRANCOIS~/dev/AvaloniaFrameBufferDRMTest/.conf/installDepsScripts: ./installDotnetSDK7.sh
/etc/os-release: line 4: Environment: command not found

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

--2024-06-26 16:15:23--  https://packages.microsoft.com/config/ubuntu/12/packages-microsoft-prod.deb
Resolving packages.microsoft.com (packages.microsoft.com)... 13.107.246.42, 2620:1ec:bdf::42
Connecting to packages.microsoft.com (packages.microsoft.com)|13.107.246.42|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-06-26 16:15:23 ERROR 404: Not Found.

Could please assist me on this ?

Sincerely,

François.

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello François,

The issue you’re encountering seems to stem from a couple of factors related to the environment setup and the script’s handling of the Torizon OS environment within WSL 2. Let’s address these step by step:

  1. Incorrect URL for .NET SDK Package: The script attempts to download the .NET SDK package from a URL constructed for Ubuntu 12, which is incorrect and results in a 404 error. This is likely due to the script misidentifying the environment or an incorrect repo_version being set when the environment is identified as Torizon ($ID = "torizon").

  2. Error in /etc/os-release Parsing: The error message /etc/os-release: line 4: Environment: command not found suggests there might be an issue with how environment variables or file content is being parsed or executed. This could be due to an unexpected format or characters in the /etc/os-release file.

  3. Handling Torizon OS in WSL 2: The script has a condition to handle torizon as an ID, setting it to use Debian packages. However, the version set (repo_version="12") does not correspond to a valid Microsoft package repository for .NET SDK, leading to the 404 error.

To resolve these issues, consider the following steps:

  • Correct Environment Detection: Ensure the script correctly identifies the environment. For Torizon OS in WSL 2, you might need a specific handling case that does not rely on the Debian or Ubuntu package sources for .NET SDK, especially since Torizon is not directly compatible with these repositories for .NET installations.

  • Manual Installation of .NET SDK: As a workaround, consider manually installing the .NET SDK by following the official Microsoft documentation, ensuring you select the correct version and source for your environment. This might involve downloading the SDK directly from Microsoft and bypassing the script’s automated process.

  • Review /etc/os-release: Check the content of your /etc/os-release file for any anomalies or formatting issues that could cause script execution problems. The error message suggests the script might be attempting to execute a line from this file as a command.

  • Script Modification: Modify the script to handle the Torizon environment more gracefully. This might involve setting a correct URL for the .NET SDK download or skipping certain steps that are not applicable to the Torizon OS environment within WSL 2.

Given the specific nature of the Torizon OS and its environment within WSL 2,

Please, also check if these links can help you solve your problem:

Application Development - .NET Example | Toradex Developer Center.

Greetings @flepron,

Something doesn’t seem right here. The installDotnetSDK7.sh script from your project you shared. It’s not the same as the one in my freshly created Avalonia .NET 8.0 Frame Buffer project:

#!/bin/bash
set -e

# This is a script to install .NET on Ubuntu, based on the official Microsoft recommended method of installation:
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

package='dotnet-sdk-7.0'

# Get Ubuntu version
declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)

# Get the source URL of the dotnet-sdk package installed
source=$(apt policy $package | awk '/ \*/{getline; print $2}')


# Check if the dotnet-sdk installed package comes from the Microsoft source
if [ "$source" != "https://packages.microsoft.com/ubuntu/$repo_version/prod" ]; then

    # Download Microsoft signing key and repository
    wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

    # Install Microsoft signing key and repository
    sudo dpkg -i packages-microsoft-prod.deb

    # Clean up
    rm packages-microsoft-prod.deb

    # Remove the dotnet-sdk installation that doesn't come from the Microsoft source
    sudo apt-get remove --purge $package -y

    sudo apt-get autoremove -y

    # Enforce the preference for the dotnet and aspnet packages comming from the Microsoft source
    if [ ! -f /etc/apt/preferences ] || ! grep -q "Package: dotnet\* aspnet\* netstandard\*" /etc/apt/preferences
    then
        echo "Package: dotnet* aspnet* netstandard*" | sudo tee -a /etc/apt/preferences
        echo "Pin: origin packages.microsoft.com" | sudo tee -a /etc/apt/preferences
        echo "Pin-Priority: 1001" | sudo tee -a /etc/apt/preferences

    fi

fi

# Update packages
sudo apt-get update -y

# Install the dotnet-sdk that come from the Microsoft source
sudo apt-get install $package -y

It’s similar but you can see it’s not the same. I imagine this difference is why the script is not behaving correctly for you. Did you create this project a long time ago and this was how the script was in the past maybe?

Best Regards,
Jeremias

Hi @jeremias.tx

I have created this project 2 days ago, on the 24th or on the 25th of June 2024.

I don’t know if this can affect my setup, but I try to give you as much information as I can to fix this issue, but I have cloned the repository advised by @matheus.tx (GitHub - toradex/vscode-torizon-templates: VS Code Torizon Integrated Development Environment Templates), but there is no file such as:

  • /home/torizon/dev/vscode-torizon-templates/dotnetAvaloniaFrameBuffer/.conf/installDepsScripts/installDotnetSDK7.sh
  • /home/torizon/dev/vscode-torizon-templates/dotnetAvaloniaFrameBuffer/.conf/installDepsScripts/installDotnetSDK8.sh

Because there is no directory /home/torizon/dev/vscode-torizon-templates/dotnetAvaloniaFrameBuffer/.conf/installDepsScripts.

But, I think that we do not have to search in this direction since these projects are in two directory on my WSL2 Torizon.

I have tried today to make another try using another Torizon template project : Avalonia GTK MVVM C#/.NET 8.0 (See on following screenshots), how I proceed.

Checking dependencies ...
👍 openssh-client debian package dependency installed
👍 sshpass debian package dependency installed
😵 libgtk-3-dev debian package dependency not installed
😵 .conf/installDepsScripts/installDotnetSDK7.sh dependency installation script not executed before for this project
😵 .conf/installDepsScripts/installDotnetSDK8.sh dependency installation script not executed before for this project
Try to install the missing debian packages and execute the missing installation scripts? <y/N>: y
[sudo] password for torizon: 
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]                                    
Get:3 https://download.docker.com/linux/debian bookworm InRelease [43.3 kB]                                   
Get:4 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Hit:5 https://packages.microsoft.com/debian/12/prod bookworm InRelease                      
Get:6 https://download.docker.com/linux/debian bookworm/stable amd64 Packages [25.7 kB]
Get:7 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [161 kB]
Fetched 333 kB in 0s (1497 kB/s)  
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  adwaita-icon-theme at-spi2-common at-spi2-core dconf-gsettings-backend dconf-service fontconfig gir1.2-atk-1.0 gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0
  gir1.2-harfbuzz-0.0 gir1.2-pango-1.0 gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme icu-devtools libatk-bridge2.0-0 libatk-bridge2.0-dev libatk1.0-0 libatk1.0-dev libatspi2.0-0
  libatspi2.0-dev libblkid-dev libbrotli-dev libcairo-gobject2 libcairo-script-interpreter2 libcairo2 libcairo2-dev libcolord2 libcups2 libdatrie-dev libdatrie1 libdbus-1-dev libdconf1 libdeflate-dev
  libepoxy-dev libepoxy0 libexpat1-dev libfontconfig-dev libfreetype-dev libfribidi-dev libfribidi0 libgdk-pixbuf-2.0-0 libgdk-pixbuf-2.0-dev libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgirepository-1.0-1
  libglib2.0-bin libglib2.0-dev libglib2.0-dev-bin libgraphite2-3 libgraphite2-dev libgtk-3-0 libgtk-3-bin libgtk-3-common libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libharfbuzz-subset0
  libharfbuzz0b libice-dev libicu-dev libjbig-dev libjpeg-dev libjpeg62-turbo-dev liblcms2-2 liblerc-dev liblzma-dev liblzo2-2 libmount-dev libpango-1.0-0 libpango1.0-dev libpangocairo-1.0-0 libpangoft2-1.0-0
  libpangoxft-1.0-0 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpixman-1-0 libpixman-1-dev libpkgconf3 libpng-dev libpng-tools libpython3-stdlib librsvg2-2 librsvg2-common libselinux1-dev
  libsepol-dev libsm-dev libthai-data libthai-dev libthai0 libtiff-dev libtiffxx6 libwebp-dev libwebpdemux2 libwebpmux3 libxcb-render0 libxcb-render0-dev libxcb-shm0-dev libxcomposite-dev libxcomposite1
  libxcursor-dev libxdamage-dev libxdamage1 libxext-dev libxfixes-dev libxft-dev libxft2 libxi-dev libxinerama-dev libxinerama1 libxkbcommon-dev libxrandr-dev libxrender-dev libxtst-dev libxtst6 libzstd-dev
  pango1.0-tools pkg-config pkgconf pkgconf-bin python3 python3-distutils python3-lib2to3 python3-minimal python3.11 python3.11-minimal sgml-base uuid-dev xml-core zlib1g-dev

...

Unpacking librsvg2-common:amd64 (2.54.7+dfsg-1~deb12u1) ...
Setting up libgraphite2-3:amd64 (1.3.14-1) ...
Setting up liblcms2-2:amd64 (2.14-2) ...
Setting up libpixman-1-0:amd64 (0.42.2-1) ...
Setting up python3.11 (3.11.2-6) ...
Setting up fontconfig (2.14.1-4) ...
Regenerating fonts cache... done.
Setting up libxft2:amd64 (2.3.6-1) ...
Setting up libpixman-1-dev:amd64 (0.42.2-1) ...
Setting up libxdamage1:amd64 (1:1.1.6-1) ...
Setting up libzstd-dev:amd64 (1.5.4+dfsg2-5) ...
Setting up hicolor-icon-theme (0.17-2) ...
Setting up libdatrie1:amd64 (0.2.13-2+b1) ...
Setting up libice-dev:amd64 (2:1.0.10-1) ...
Setting up libpng-tools (1.6.39-2) ...
Setting up libxcb-render0:amd64 (1.15-1) ...
Setting up libsm-dev:amd64 (2:1.2.3-1) ...
Setting up libxtst6:amd64 (2:1.2.3-1.1) ...
Setting up libwebpdemux2:amd64 (1.2.4-0.2+deb12u1) ...
Setting up libxkbcommon-dev:amd64 (1.5.0-1) ...
Setting up libgdk-pixbuf2.0-common (2.42.10+dfsg-1) ...
Setting up libjbig-dev:amd64 (2.1-6.1) ...
Setting up libglib2.0-bin (2.74.6-2+deb12u2) ...
Setting up liblzo2-2:amd64 (2.10-2) ...
Setting up libatspi2.0-0:amd64 (2.46.0-5) ...
Setting up libcairo2:amd64 (1.16.0-7) ...
Setting up libpcre2-16-0:amd64 (10.42-1) ...
Setting up libcolord2:amd64 (1.4.6-2.2) ...
Setting up libdconf1:amd64 (0.40.0-4) ...
Setting up libxfixes-dev:amd64 (1:6.0.0-2) ...
Setting up libxcb-shm0-dev:amd64 (1.15-1) ...
Setting up libgraphite2-dev:amd64 (1.3.14-1) ...
Setting up libpcre2-32-0:amd64 (10.42-1) ...
Setting up libpkgconf3:amd64 (1.8.1-1) ...
Setting up libexpat1-dev:amd64 (2.5.0-1) ...
Setting up libjpeg62-turbo-dev:amd64 (1:2.1.5-2) ...
Setting up libepoxy0:amd64 (1.5.10-1) ...
Setting up uuid-dev:amd64 (2.38.1-5+deb12u1) ...
Setting up libfribidi0:amd64 (1.0.8-2.1) ...
Setting up libxinerama1:amd64 (2:1.1.4-3) ...
Setting up icu-devtools (72.1-3) ...
Setting up libsepol-dev:amd64 (3.4-2.1) ...
Setting up libxcb-render0-dev:amd64 (1.15-1) ...
Setting up pkgconf-bin (1.8.1-1) ...
Setting up liblerc-dev:amd64 (4.0.0+ds-2) ...
Setting up libxext-dev:amd64 (2:1.3.4-1+b1) ...
Setting up liblzma-dev:amd64 (5.4.1-0.2) ...
Setting up libcups2:amd64 (2.4.2-3+deb12u5) ...
Setting up zlib1g-dev:amd64 (1:1.2.13.dfsg-1) ...
Setting up libpcre2-posix3:amd64 (10.42-1) ...
Setting up at-spi2-common (2.46.0-5) ...
Setting up libharfbuzz0b:amd64 (6.0.0+dfsg-3) ...
Setting up libthai-data (0.1.29-1) ...
Setting up libgirepository-1.0-1:amd64 (1.74.0-3) ...
Setting up libgdk-pixbuf-2.0-0:amd64 (2.42.10+dfsg-1+b1) ...
Setting up sgml-base (1.31) ...
Setting up libcairo-gobject2:amd64 (1.16.0-7) ...
Setting up libatk1.0-0:amd64 (2.46.0-5) ...
Setting up libxi-dev:amd64 (2:1.8-1+b1) ...
Setting up libwebpmux3:amd64 (1.2.4-0.2+deb12u1) ...
Setting up libtiffxx6:amd64 (4.5.0-6+deb12u1) ...
Setting up libdeflate-dev:amd64 (1.14-1) ...
Setting up libxcomposite1:amd64 (1:0.4.5-1) ...
Setting up libxrender-dev:amd64 (1:0.9.10-1.1) ...
Setting up libicu-dev:amd64 (72.1-3) ...
Setting up libbrotli-dev:amd64 (1.0.9-2+b6) ...
Setting up libpython3-stdlib:amd64 (3.11.2-1+b1) ...
Setting up libxtst-dev:amd64 (2:1.2.3-1.1) ...
Setting up libxdamage-dev:amd64 (1:1.1.6-1) ...
Setting up libcairo-script-interpreter2:amd64 (1.16.0-7) ...
Setting up libblkid-dev:amd64 (2.38.1-5+deb12u1) ...
Setting up gtk-update-icon-cache (3.24.38-2~deb12u1) ...
Setting up libharfbuzz-icu0:amd64 (6.0.0+dfsg-3) ...
Setting up libpcre2-dev:amd64 (10.42-1) ...
Setting up libselinux1-dev:amd64 (3.4-1+b6) ...
Setting up libxcomposite-dev:amd64 (1:0.4.5-1) ...
Setting up libxcursor-dev:amd64 (1:1.2.1-1) ...
Setting up libfribidi-dev:amd64 (1.0.8-2.1) ...
Setting up libepoxy-dev:amd64 (1.5.10-1) ...
Setting up libpng-dev:amd64 (1.6.39-2) ...
Setting up libjpeg-dev:amd64 (1:2.1.5-2) ...
Setting up dconf-service (0.40.0-4) ...
Setting up python3 (3.11.2-1+b1) ...
running python rtupdate hooks for python3.11...
running python post-rtupdate hooks for python3.11...
Setting up libharfbuzz-gobject0:amd64 (6.0.0+dfsg-3) ...
Setting up pkgconf:amd64 (1.8.1-1) ...
Setting up libfreetype-dev:amd64 (2.12.1+dfsg-5) ...
Setting up libatk-bridge2.0-0:amd64 (2.46.0-5) ...
Setting up libthai0:amd64 (0.1.29-1) ...
Setting up libxrandr-dev:amd64 (2:1.5.2-2+b1) ...
Setting up libwebp-dev:amd64 (1.2.4-0.2+deb12u1) ...
Setting up adwaita-icon-theme (43-1) ...
update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide /usr/share/icons/default/index.theme (x-cursor-theme) in auto mode
Setting up libtiff-dev:amd64 (4.5.0-6+deb12u1) ...
Setting up pkg-config:amd64 (1.8.1-1) ...
Setting up libxinerama-dev:amd64 (2:1.1.4-3) ...
Setting up gir1.2-glib-2.0:amd64 (1.74.0-3) ...
Setting up libdatrie-dev:amd64 (0.2.13-2+b1) ...
Setting up libgdk-pixbuf2.0-bin (2.42.10+dfsg-1+b1) ...
Setting up xml-core (0.18+nmu1) ...
Setting up libharfbuzz-subset0:amd64 (6.0.0+dfsg-3) ...
Setting up python3-lib2to3 (3.11.2-3) ...
Setting up libmount-dev:amd64 (2.38.1-5+deb12u1) ...
Setting up python3-distutils (3.11.2-3) ...
Setting up libglib2.0-dev-bin (2.74.6-2+deb12u2) ...
Setting up gir1.2-freedesktop:amd64 (1.74.0-3) ...
Setting up dconf-gsettings-backend:amd64 (0.40.0-4) ...
Setting up gir1.2-gdkpixbuf-2.0:amd64 (2.42.10+dfsg-1+b1) ...
Setting up libfontconfig-dev:amd64 (2.14.1-4) ...
Setting up gir1.2-atk-1.0:amd64 (2.46.0-5) ...
Setting up libpango-1.0-0:amd64 (1.50.12+ds-1) ...
Setting up gir1.2-atspi-2.0:amd64 (2.46.0-5) ...
Setting up gir1.2-harfbuzz-0.0:amd64 (6.0.0+dfsg-3) ...
Setting up libglib2.0-dev:amd64 (2.74.6-2+deb12u2) ...
Setting up libthai-dev:amd64 (0.1.29-1) ...
Setting up libpangoft2-1.0-0:amd64 (1.50.12+ds-1) ...
Setting up libgtk-3-common (3.24.38-2~deb12u1) ...
Setting up libpangocairo-1.0-0:amd64 (1.50.12+ds-1) ...
Setting up libxft-dev:amd64 (2.3.6-1) ...
Setting up gsettings-desktop-schemas (43.0-1) ...
Setting up libpangoxft-1.0-0:amd64 (1.50.12+ds-1) ...
Setting up pango1.0-tools (1.50.12+ds-1) ...
Setting up librsvg2-2:amd64 (2.54.7+dfsg-1~deb12u1) ...
Setting up gir1.2-pango-1.0:amd64 (1.50.12+ds-1) ...
Setting up librsvg2-common:amd64 (2.54.7+dfsg-1~deb12u1) ...
Processing triggers for libglib2.0-0:amd64 (2.74.6-2+deb12u2) ...
Setting up libgtk-3-0:amd64 (3.24.38-2~deb12u1) ...
Processing triggers for libc-bin (2.36-9+deb12u7) ...
ldconfig: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Setting up gir1.2-gtk-3.0:amd64 (3.24.38-2~deb12u1) ...
Setting up libgtk-3-bin (3.24.38-2~deb12u1) ...
Processing triggers for systemd (252.22-1~deb12u1) ...
Setting up at-spi2-core (2.46.0-5) ...
Setting up libcairo2-dev:amd64 (1.16.0-7) ...
Setting up libatk1.0-dev:amd64 (2.46.0-5) ...
Setting up libgdk-pixbuf-2.0-dev:amd64 (2.42.10+dfsg-1+b1) ...
Setting up libharfbuzz-dev:amd64 (6.0.0+dfsg-3) ...
Setting up libpango1.0-dev:amd64 (1.50.12+ds-1) ...
Processing triggers for sgml-base (1.31) ...
Setting up libdbus-1-dev:amd64 (1.14.10-1~deb12u1) ...
Setting up libatspi2.0-dev:amd64 (2.46.0-5) ...
Setting up libatk-bridge2.0-dev:amd64 (2.46.0-5) ...
Setting up libgtk-3-dev:amd64 (3.24.38-2~deb12u1) ...
Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.10+dfsg-1+b1) ...
/etc/os-release: line 4: Environment: command not found

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

--2024-06-27 09:20:57--  https://packages.microsoft.com/config/ubuntu/12/packages-microsoft-prod.deb
Resolving packages.microsoft.com (packages.microsoft.com)... 13.107.246.42, 2620:1ec:bdf::42
Connecting to packages.microsoft.com (packages.microsoft.com)|13.107.246.42|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-06-27 09:20:57 ERROR 404: Not Found.

❌ error trying to execute the dependency installation script .conf/installDepsScripts/installDotnetSDK7.sh

 *  The terminal process "pwsh '-nop', '/home/torizon/dev/AvaloniaGTKMVVM/.conf/checkDeps.ps1'" terminated with exit code: 69. 
 *  Terminal will be reused by tasks, press any key to close it.

And the content of the file /home/torizon/dev/AvaloniaGTKMVVM/.conf/installDepsScripts/installDotnetSDK7.sh is as follow:

🐧 torizon @LAPTOPFRANCOIS~/dev/AvaloniaGTKMVVM: cat .conf/installDepsScripts/installDotnetSDK7.sh
#!/bin/bash
set -e

# This is a script to install .NET on Ubuntu, based on the official Microsoft recommended method of installation:
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

package='dotnet-sdk-7.0'

# Check if we are running on the LTS Ubuntu or Debian
if [ -f /etc/os-release ]; then
   # unset the exit with error
   set +e
   . /etc/os-release
   set -e

   if [ "$ID" = "ubuntu" ]; then
       repo="ubuntu"
       repo_version="24.04"
   elif [ "$ID" = "debian" ]; then
       repo="debian"
       repo_version="12"
   elif [ "$ID" = "torizon" ]; then
       repo="debian"
       repo_version="12"
   else
       echo "🔴 Unsupported distribution"
       echo "Please use the latest LTS of Debian or Ubuntu"
       echo "If you are using WSL 2 check the Torizon OS environment for WSL 2: https://bit.ly/4b2T1hd"
       exit 69
   fi
else
   echo "Unsupported distribution"
   exit 69
fi

# Get the source URL of the dotnet-sdk package installed
source=$(apt policy $package | awk '/ \*/{getline; print $2}')


# Check if the dotnet-sdk installed package comes from the Microsoft source
if [ "$source" != "https://packages.microsoft.com/ubuntu/$repo_version/prod" ]; then

   # Download Microsoft signing key and repository
   wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

   # Install Microsoft signing key and repository
   sudo dpkg -i packages-microsoft-prod.deb

   # Clean up
   rm packages-microsoft-prod.deb

   # Remove the dotnet-sdk installation that doesn't come from the Microsoft source
   sudo apt-get remove --purge $package -y

   sudo apt-get autoremove -y

   # Enforce the preference for the dotnet and aspnet packages comming from the Microsoft source
   if [ ! -f /etc/apt/preferences ] || ! grep -q "Package: dotnet\* aspnet\* netstandard\*" /etc/apt/preferences
   then
       echo "Package: dotnet* aspnet* netstandard*" | sudo tee -a /etc/apt/preferences
       echo "Pin: origin packages.microsoft.com" | sudo tee -a /etc/apt/preferences
       echo "Pin-Priority: 1001" | sudo tee -a /etc/apt/preferences

   fi

fi

# Update packages
sudo apt-get update -y

# Install the dotnet-sdk that come from the Microsoft source
sudo apt-get install $package -y
🐧 torizon @LAPTOPFRANCOIS~/dev/AvaloniaGTKMVVM:

This script is absolutely the same as the one which has been generated using the Torizon project template Avalonia .NET 8.0 Frame Buffer DRM.

Could you please help me because I do not see what’s going on and I can find a workaround by replacing the lines:

# Check if the dotnet-sdk installed package comes from the Microsoft source
if [ "$source" != "https://packages.microsoft.com/ubuntu/$repo_version/prod" ]; then

  # Download Microsoft signing key and repository
  wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

by

# Check if the dotnet-sdk installed package comes from the Microsoft source
if [ "$source" != "https://packages.microsoft.com/$repo/$repo_version/prod" ]; then

  # Download Microsoft signing key and repository
  wget https://packages.microsoft.com/config/$repo/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

but, I am afraid of finding out new bugs in other configuration files, and I will waste too mush time.

Thank you for your coming advises and recommendations.

Sincerely,
François.

Hey @flepron

sorry to hear that you are having issues. The templates from Torizon Environment for WSL comes from the next channel toradex/vscode-torizon-templates at next (github.com), that are also experimental for now.

Thanks for report this issue, this was fixed for SDK 8 but not for 6 and 7. Now is fixed.

Let us know if you get any other issue.

Best Regards,

2 Likes

Hi @matheus.tx

Thank you so much for this quick fix.

This will help the community.

This was the purpose of my post.

Have a nice day in your awesome and fabulous country : :brazil: :heart: :brazil:

Sincerely,
François

1 Like