-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bash: dotnet: command not found (.NET 6 installed on CentOS 7) #62208
Comments
I tested it in a clean environment: # bash
$ mkdir foo && cd $_
$ cat > Dockerfile <<EOF
FROM centos:7
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
RUN yum update -y
RUN yum install -y dotnet-sdk-5.0
RUN dotnet --info
RUN yum install -y dotnet-sdk-6.0
ENTRYPOINT dotnet --info
EOF
$ docker build -t test1 . Then running .NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Runtime Environment:
OS Name: centos
OS Version: 7
OS Platform: Linux
RID: centos.7-x64
Base Path: /usr/share/dotnet/sdk/6.0.100/
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
5.0.403 [/usr/share/dotnet/sdk]
6.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download as expected. So it might be something in your environment (variable like |
I can fix it with this commands:
|
In case more details are needed, it looks like the postuninstall scriptlet of the RPM is just missing it's "$1 == 0" guard around the symlink removal. And since the bugged script versions of the RPM are out there, just fixing this won't be enough to ensure the symlink exists with future updates. It should be fixable by just adding the $1==0 safeguard in %postun (so it only removes the symlink if rpm is the last one being removed), as well as add a %posttrans so at the end, the new updated RPM ensures the symlink really does exist (i.e. one of these bugged 6.x versions didn't remove the symlink). No guard is needed there since %posttrans only runs if the RPM is still around: Current:
Fixed/recovery version:
|
Closing as this was resolved long time ago. |
Description
"bash: dotnet: command not found" like closed #3846 after reinstall .NET6 over .NET5 on CentOS 7.9, and same issue #3603 on macOS.
Reproduction Steps
Take a clean CentOS 7.9 installation.
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install dotnet-sdk-5.0
(your page https://docs.microsoft.com/ru-ru/dotnet/core/install/linux-centos should be updated upto v6).dotnet --info
=> .NET5It's ok.
...
Now trying to update with an over-installation of same 6.0:
sudo yum install dotnet-sdk-6.0
dotnet --info
=> still .NET5 only? none of .NET6It's wrong!
Many bad attempts to clean these installations to get 6.0, including the total erasing of folders...
sudo yum install dotnet-sdk-6.0
(expected to reinstall everything required)dotnet --info
=> "bash: dotnet: command not found"Expected behavior
dotnet
Actual behavior
bash: dotnet: command not found
Regression?
No response
Known Workarounds
sudo yum install dotnet-sdk-6.0
Test
ls /usr/share/dotnet
=> "sdk sdk-manifests shared templates" (nodotnet
installed)Workaround:
Test
ls /usr/share/dotnet
=> "dotnet host packs sdk sdk-manifests shared templates" (dotnet
and two folders added)Configuration
dotnet --info
=>Other information
Expected the running (first time or any later) of
sudo yum install dotnet-sdk-6.0
will make additionally:Or add some documentation near
dotnet-install.sh
(as it writes on its run: not recommended for the system install).The text was updated successfully, but these errors were encountered: