-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Linux installers are not creating /etc/dotnet/install_location file #82858
Comments
This should be backported to all supported releases. |
This is technically a breaking change, so we should document that. |
What Ubuntu looks like: $ docker run --rm -it ubuntu:jammy
root@4da5efec1e6f:/# apt update && apt install -y dotnet6
root@4da5efec1e6f:/# ls /etc/dotnet
install_location install_location_x64
root@4da5efec1e6f:/# cat /etc/dotnet/install_location
/usr/lib/dotnet
root@4da5efec1e6f:/# export | grep DOTNET
root@4da5efec1e6f:/# |
DEB packages built by Ubuntu and provided in Ubuntu feeds do have |
Exactly. That is what I meant, but didn't say. Thanks for clarifying. Does our guidance cover this case? |
Our packaging guidance (https://learn.microsoft.com/en-us/dotnet/core/distribution-packaging) has a section about this file: (16) /etc/dotnet/install_location is a file that contains the full path for {dotnet_root}. The path may end with a newline. It's not necessary to add this file when the root is /usr/share/dotnet. However, it does not require it, if .NET root is Linux - the host searches in /usr/share/dotnet as a fallback, but the installer may pick a different default based on the requirements of the specific distro/configuration. In such case the install is effectively just like the global install to custom location described below. If correctly registered the host will search the custom location first. The fix for this issue is likely not needed. |
If a system has migrated from Ubuntu distro package installation for dotnet, we found that A fix is required. EDIT: NOTE: Not sure entirely what all will depend on this, but we found Rider IDE relies on it and thus doesn't function properly in this scenario/state. |
This sounds like a "Mixed state scenario 2" from our Ubuntu guidance document: dotnet/core#7699. Switching from Ubuntu to Microsoft-built packages require complete uninstall of .NET related packages before installing packages from https://packages.microsoft.com. Uninstall would correctly remove |
did |
is the recommendation to REMOVE these files, or ensure they point to either way the Microsoft package installers should probably be checking the system against whatever the requirement is |
Thanks. I see the same issue on 22.04. It seems that Ubuntu-built .NET packages are not cleaning these files from the machine. This seems by design, as plain |
Beyond updating the guidance doc tho; Shouldn't the PMC packages also verify this state? (otherwise users will forever be plagued by this problem and likely we'll be spurring more github issue submissions in the future ...) |
Maybe also consider: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_root-dotnet_rootx86 (default location varies now on Linux) |
Also just found this ... finally figured out what was setting
EDIT: there is also some dotnet tool ENV var items in there ... here's a snip of the script that is left on a Ubuntu 22.04 system (after having installed the packages from Ubuntu package source) $ cat /etc/profile.d/dotnet.sh
# Set location for AppHost lookup
export DOTNET_ROOT=/usr/lib/dotnet
# Add dotnet tools directory to PATH
DOTNET_TOOLS_PATH="$HOME/.dotnet/tools"
case "$PATH" in
*"$DOTNET_TOOLS_PATH"* ) true ;;
* ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;;
esac
# Extract self-contained executables under HOME
# to avoid multi-user issues from using the default '/var/tmp'.
[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"$HOME"/.cache}/dotnet_bundle_extract" |
[Triage] @mirespace, this file should not be left on user's machine when .NET is uninstalled. Is this something that should be fixed in Ubuntu's .NET packages? |
Hi @NikolaMilosavljevic , Using
Just in case, I checked the steps you provided there, and they are working fine:
The most relevant line there is I'm afraid that removing the configuration files under /etc without using --purge is a different request because it wouldn't follow the standards. |
It appears that Microsoft-built .NET installers, provided on https://packages.microsoft.com, are not creating
/etc/dotnet/install_location
file on Linux systems. The file gets created on OSX.This causes issues for customers that want to customize the install location due to 1) missing file, and 2) default permissions for new file, created by customer.
.NET installer should create this file, according to design document: https://github.com/dotnet/designs/blob/main/accepted/2020/install-locations.md
The text was updated successfully, but these errors were encountered: