skip to Main Content

I have followed instructions in a couple of places to install .Net SDKs on CentOS (Stream release 9).

enter image description here

Why is dotnet --info not showing installed SDKs?

2

Answers


  1. When i tried to install from this Microsoft page i had no success.

    Then i tried this:

    RUN dnf install dotnet-sdk-7.0 -y

    after this, i ran dotnet --info with this output:

    [root@ebf572389108 .dotnet]#  dnf install dotnet-sdk-7.0 -y
    CentOS Stream 9 - BaseOS                                                                                  5.8 MB/s | 8.4 MB     00:01    
    CentOS Stream 9 - AppStream                                                                                12 MB/s |  15 MB     00:01    
    CentOS Stream 9 - Extras packages                                                                          16 kB/s |  12 kB     00:00    
    Dependencies resolved.
    ==========================================================================================================================================
     Package                                         Architecture             Version                        Repository                  Size
    ==========================================================================================================================================
    Installing:
     dotnet-sdk-7.0                                  aarch64                  7.0.105-2.el9                  appstream                   83 M
    Installing dependencies:
     aspnetcore-runtime-7.0                          aarch64                  7.0.5-2.el9                    appstream                  7.0 M
     aspnetcore-targeting-pack-7.0                   aarch64                  7.0.5-2.el9                    appstream                  1.6 M
     dotnet-apphost-pack-7.0                         aarch64                  7.0.5-2.el9                    appstream                  3.6 M
     dotnet-host                                     aarch64                  7.0.5-2.el9                    appstream                  196 k
     dotnet-hostfxr-7.0                              aarch64                  7.0.5-2.el9                    appstream                  158 k
     dotnet-runtime-7.0                              aarch64                  7.0.5-2.el9                    appstream                   22 M
     dotnet-targeting-pack-7.0                       aarch64                  7.0.5-2.el9                    appstream                  2.7 M
     dotnet-templates-7.0                            aarch64                  7.0.105-2.el9                  appstream                  2.7 M
     libicu                                          aarch64                  67.1-9.el9                     baseos                     9.5 M
     lttng-ust                                       aarch64                  2.12.0-6.el9                   appstream                  288 k
     netstandard-targeting-pack-2.1                  aarch64                  7.0.105-2.el9                  appstream                  1.3 M
     numactl-libs                                    aarch64                  2.0.14-7.el9                   baseos                      30 k
     userspace-rcu                                   aarch64                  0.12.1-6.el9                   baseos                     110 k
    
    Transaction Summary
    ==========================================================================================================================================
    Install  14 Packages
    
    Total download size: 134 M
    Installed size: 528 M
    Downloading Packages:
    (1/14): numactl-libs-2.0.14-7.el9.aarch64.rpm                                                             264 kB/s |  30 kB     00:00    
    (2/14): userspace-rcu-0.12.1-6.el9.aarch64.rpm                                                            642 kB/s | 110 kB     00:00    
    (3/14): aspnetcore-runtime-7.0-7.0.5-2.el9.aarch64.rpm                                                    8.7 MB/s | 7.0 MB     00:00    
    (4/14): aspnetcore-targeting-pack-7.0-7.0.5-2.el9.aarch64.rpm                                             1.7 MB/s | 1.6 MB     00:00    
    (5/14): dotnet-host-7.0.5-2.el9.aarch64.rpm                                                               2.9 MB/s | 196 kB     00:00    
    (6/14): libicu-67.1-9.el9.aarch64.rpm                                                                     7.8 MB/s | 9.5 MB     00:01    
    (7/14): dotnet-hostfxr-7.0-7.0.5-2.el9.aarch64.rpm                                                        2.7 MB/s | 158 kB     00:00    
    (8/14): dotnet-apphost-pack-7.0-7.0.5-2.el9.aarch64.rpm                                                   4.3 MB/s | 3.6 MB     00:00    
    (9/14): dotnet-runtime-7.0-7.0.5-2.el9.aarch64.rpm                                                         21 MB/s |  22 MB     00:01    
    (10/14): dotnet-targeting-pack-7.0-7.0.5-2.el9.aarch64.rpm                                                4.8 MB/s | 2.7 MB     00:00    
    (11/14): lttng-ust-2.12.0-6.el9.aarch64.rpm                                                               2.2 MB/s | 288 kB     00:00    
    (12/14): netstandard-targeting-pack-2.1-7.0.105-2.el9.aarch64.rpm                                         2.4 MB/s | 1.3 MB     00:00    
    (13/14): dotnet-templates-7.0-7.0.105-2.el9.aarch64.rpm                                                   2.2 MB/s | 2.7 MB     00:01    
    (14/14): dotnet-sdk-7.0-7.0.105-2.el9.aarch64.rpm                                                          20 MB/s |  83 MB     00:04    
    ------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                      21 MB/s | 134 MB     00:06     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :                                                                                                                  1/1 
      Installing       : dotnet-host-7.0.5-2.el9.aarch64                                                                                 1/14 
      Installing       : aspnetcore-targeting-pack-7.0-7.0.5-2.el9.aarch64                                                               2/14 
      Installing       : dotnet-apphost-pack-7.0-7.0.5-2.el9.aarch64                                                                     3/14 
      Installing       : dotnet-hostfxr-7.0-7.0.5-2.el9.aarch64                                                                          4/14 
      Installing       : dotnet-targeting-pack-7.0-7.0.5-2.el9.aarch64                                                                   5/14 
      Installing       : dotnet-templates-7.0-7.0.105-2.el9.aarch64                                                                      6/14 
      Installing       : netstandard-targeting-pack-2.1-7.0.105-2.el9.aarch64                                                            7/14 
      Installing       : userspace-rcu-0.12.1-6.el9.aarch64                                                                              8/14 
      Installing       : numactl-libs-2.0.14-7.el9.aarch64                                                                               9/14 
      Installing       : lttng-ust-2.12.0-6.el9.aarch64                                                                                 10/14 
      Installing       : libicu-67.1-9.el9.aarch64                                                                                      11/14 
      Installing       : dotnet-runtime-7.0-7.0.5-2.el9.aarch64                                                                         12/14 
      Installing       : aspnetcore-runtime-7.0-7.0.5-2.el9.aarch64                                                                     13/14 
      Installing       : dotnet-sdk-7.0-7.0.105-2.el9.aarch64                                                                           14/14 
      Running scriptlet: dotnet-sdk-7.0-7.0.105-2.el9.aarch64                                                                           14/14 
      Verifying        : libicu-67.1-9.el9.aarch64                                                                                       1/14 
      Verifying        : numactl-libs-2.0.14-7.el9.aarch64                                                                               2/14 
      Verifying        : userspace-rcu-0.12.1-6.el9.aarch64                                                                              3/14 
      Verifying        : aspnetcore-runtime-7.0-7.0.5-2.el9.aarch64                                                                      4/14 
      Verifying        : aspnetcore-targeting-pack-7.0-7.0.5-2.el9.aarch64                                                               5/14 
      Verifying        : dotnet-apphost-pack-7.0-7.0.5-2.el9.aarch64                                                                     6/14 
      Verifying        : dotnet-host-7.0.5-2.el9.aarch64                                                                                 7/14 
      Verifying        : dotnet-hostfxr-7.0-7.0.5-2.el9.aarch64                                                                          8/14 
      Verifying        : dotnet-runtime-7.0-7.0.5-2.el9.aarch64                                                                          9/14 
      Verifying        : dotnet-sdk-7.0-7.0.105-2.el9.aarch64                                                                           10/14 
      Verifying        : dotnet-targeting-pack-7.0-7.0.5-2.el9.aarch64                                                                  11/14 
      Verifying        : dotnet-templates-7.0-7.0.105-2.el9.aarch64                                                                     12/14 
      Verifying        : lttng-ust-2.12.0-6.el9.aarch64                                                                                 13/14 
      Verifying        : netstandard-targeting-pack-2.1-7.0.105-2.el9.aarch64                                                           14/14 
    
    Installed:
      aspnetcore-runtime-7.0-7.0.5-2.el9.aarch64                      aspnetcore-targeting-pack-7.0-7.0.5-2.el9.aarch64                       
      dotnet-apphost-pack-7.0-7.0.5-2.el9.aarch64                     dotnet-host-7.0.5-2.el9.aarch64                                         
      dotnet-hostfxr-7.0-7.0.5-2.el9.aarch64                          dotnet-runtime-7.0-7.0.5-2.el9.aarch64                                  
      dotnet-sdk-7.0-7.0.105-2.el9.aarch64                            dotnet-targeting-pack-7.0-7.0.5-2.el9.aarch64                           
      dotnet-templates-7.0-7.0.105-2.el9.aarch64                      libicu-67.1-9.el9.aarch64                                               
      lttng-ust-2.12.0-6.el9.aarch64                                  netstandard-targeting-pack-2.1-7.0.105-2.el9.aarch64                    
      numactl-libs-2.0.14-7.el9.aarch64                               userspace-rcu-0.12.1-6.el9.aarch64                                      
    
    Complete!
    
    

    Then with

    dotnet --info

    i got this (you can observe the same commit as yours, on the host Commit: 8042d61b17, so this version could be good for you).

    [root@ebf572389108 .dotnet]# dotnet --info
    .NET SDK:
     Version:   7.0.105
     Commit:    e1bc5e001c
    
    Runtime Environment:
     OS Name:     centos
     OS Version:  9
     OS Platform: Linux
     RID:         centos.9-arm64
     Base Path:   /usr/lib64/dotnet/sdk/7.0.105/
    
    Host:
      Version:      7.0.5
      Architecture: arm64
      Commit:       8042d61b17
    
    .NET SDKs installed:
      7.0.105 [/usr/lib64/dotnet/sdk]
    
    .NET runtimes installed:
      Microsoft.AspNetCore.App 7.0.5 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 7.0.5 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
    
    Other architectures found:
      None
    
    Environment variables:
      DOTNET_ROOT       [//.dotnet]
    
    global.json file:
      Not found
    
    Learn more:
      https://aka.ms/dotnet/info
    
    Download .NET:
      https://aka.ms/dotnet/download
    

    Anyway, i could guess that in your case the script does not set the right paths.

    Note that that the architecture of mine is arm64, different from your AMD64.

    However you could try the command dnf above.

    Play with docker

    If you use docker you could try to install dotnet in a container (a fresh environment could help), like this:

    FROM dokken/centos-stream-9
    RUN  dnf install dotnet-sdk-7.0 -y
    CMD [ "tail", "-f", "/dev/null" ]
    

    build the image:

    docker build -t centos-dot2 .

    run the image:

    docker run --name cent centos-dot2
    after the command the terminal will hang this terminal window (because of tail)

    Then, from another terminal, enter in the container:

    docker exec -it cent bash

    From here you can run dotnet --info

    Finally, when you exit from the container with exit, stop it and release with:

    docker rm -f cent

    Maybe this is not the answer you were looking for, but anyway

    Hope it helps!

    Cose belle!

    Login or Signup to reply.
  2. As I understand, the .NET SDK is installed in the /opt/dotnet directory and the PATH environment variable does not include this directory, which is why the dotnet --info command is not showing the installed SDKs.

    if yes, first of all open the .bashrc like this

    nano ~/.bashrc
    

    then add this line to the end of the file

    export PATH=$PATH:/opt/dotnet
    

    after that save the file and reload the .bashrc like this

    source ~/.bashrc
    

    now enter dotnet --info command again, the installed SDKs should now be displayed!

    good luck!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search