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!
2
Answers
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: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).
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:
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!
As I understand, the
.NET SDK
is installed in the/opt/dotnet
directory and thePATH
environment variable does not include this directory, which is why thedotnet --info
command is not showing the installed SDKs.if yes, first of all open the
.bashrc
like thisthen add this line to the end of the file
after that save the file and reload the
.bashrc
like thisnow enter
dotnet --info
command again, the installed SDKs should now be displayed!good luck!