Skip to content

ashotmuradian/linux-for-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Setting up Fedora Linux for .NET Development

Linux and Linux Tools

Install latest linux distribution updates:

sudo dnf upgrade

Reboot, most probably the kernel version has been updated.

Install tools for the Network Security Services:

sudo dnf install nss-tools

Install Core Plugins for DNF:

sudo dnf install dnf-plugins-core

Git

Configure Git to ensure line endings in files you checkout are correct for Linux.

git config --global core.autocrlf input
git config --global user.email "<EMAIL>"
git config --global core.name "<NAME>"

.NET

Installation using package manager

Install .NET SDKs:

sudo dnf install \
  dotnet-sdk-6.0 \
  dotnet-sdk-7.0 \
  dotnet-sdk-8.0

Install the managed symbol (pdb) files useful to debug the .NET SDK, .NET Runtime and ASP.NET Core runtime themselves:

sudo dnf install \
  dotnet-sdk-dbg-8.0 \
  dotnet-runtime-dbg-8.0 \
  aspnetcore-runtime-dbg-8.0

Note: the symbol files provide you with an ability to not only debug the .NET SDK itself but also to navigate through the .NET source code during development. Install them if you wish Rider to navigate you to the source code files of .NET types instead of decompiled ones.

Install the archives of collections of packages needed to build the .NET SDK itself (optional):

sudo dnf install \
  dotnet-sdk-6.0-source-built-artifacts \
  dotnet-sdk-7.0-source-built-artifacts \
  dotnet-sdk-8.0-source-built-artifacts

Note: Install these packages if you build the .NET SDK itself from the source code.

Install workloads (optional):

dotnet workload update
dotnet workload install aspire
dotnet workload install android
dotnet workload install maui-android
dotnet workload install wasm-tools

Installation using dotnet-install script

Alternatively, use the dotnet-install script to install the .NET SDKs.

wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 6.0
./dotnet-install.sh --channel 7.0
./dotnet-install.sh --channel 8.0

Note: the dotnet command becomes available after configuring PATH environment variable.

Install particular .NET SDK versions (optional):

./dotnet-install.sh --version 8.0.100
./dotnet-install.sh --version 8.0.101
./dotnet-install.sh --version 8.0.102
./dotnet-install.sh --version 8.0.103
./dotnet-install.sh --version 8.0.200
./dotnet-install.sh --version 8.0.201
./dotnet-install.sh --version 8.0.202
./dotnet-install.sh --version 8.0.203
./dotnet-install.sh --version 8.0.204

Azure CLI

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo dnf install https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm
sudo dnf install azure-cli
az config set core.collect_telemetry=false
az config set core.allow_broker=false

VS Code

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
dnf check-update
sudo dnf install code

VS Code Extensions

code --install-extension Angular.ng-template
code --install-extension Dart-Code.dart-code
code --install-extension Dart-Code.flutter
code --install-extension GitHub.copilot
code --install-extension HashiCorp.HCL
code --install-extension HashiCorp.terraform
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension Oracle.mysql-shell-for-vs-code
code --install-extension esbenp.prettier-vscode
code --install-extension figma.figma-vscode-extension
code --install-extension golang.Go
code --install-extension meta.relay
code --install-extension ms-azuretools.vscode-azureresourcegroups
code --install-extension ms-azuretools.vscode-azureterraform
code --install-extension ms-azuretools.vscode-bicep
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-dotnettools.csdevkit
code --install-extension ms-graph.kiota
code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
code --install-extension ms-mssql.data-workspace-vscode
code --install-extension ms-mssql.mssql
code --install-extension ms-mssql.sql-database-projects-vscode
code --install-extension ms-ossdata.vscode-postgresql
code --install-extension ms-toolsai.vscode-ai
code --install-extension ms-toolsai.vscode-ai-remote
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
code --install-extension ms-vscode.azure-account
code --install-extension ms-vscode.hexeditor
code --install-extension ms-vscode.vscode-node-azure-pack
code --install-extension redhat.vscode-yaml
code --install-extension vitest.explorer

Terraform

sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
sudo dnf install terraform
terraform -install-autocomplete

GNOME

Enable Minimize, Maximize and Close window buttons.

gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"

Note how the colon ':' symbol defines the layout:

  • :minimize,maximize,close - place buttons on the right side.
  • close,minimize,maximize: - place buttons on the left side.
  • close:minimize,maximize - mixed placement.

Bash and GNOME sessions

Configure environment variables in ~/.bashrc:

# Uncomment if the .NET SDK was installed using the dotnet-install script.
#function _dotnet_bash_complete()
#{
#  local cur="${COMP_WORDS[COMP_CWORD]}" IFS=$'\n'
#  local candidates
#
#  read -d '' -ra candidates < <(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)
#
#  read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur")
#}

export JAVA_HOME="$HOME/.jdks/jdk-20.0.1"
if [ -d "$JAVA_HOME/bin" ] ; then
    export PATH="$JAVA_HOME/bin:$PATH"
fi

export DOTNET_CLI_TELEMETRY_OPTOUT="1"

# Uncomment if the .NET SDK was installed using the dotnet-install script.
#export DOTNET_ROOT="$HOME/.dotnet"
#if [ -d $DOTNET_ROOT ] ; then
#    export PATH="$DOTNET_ROOT:$PATH"
#    
#    complete -f -F _dotnet_bash_complete dotnet
#fi
#
#if [ -d "$DOTNET_ROOT/tools" ] ; then
#    export PATH="$DOTNET_ROOT/tools:$PATH"
#fi

export NODE_PATH="$HOME/.node/bin"
if [ -d $NODE_PATH ] ; then
    export PATH="$NODE_PATH:$PATH"
fi

export GOPATH="$HOME/.go/go1.20/bin"
if [ -d $GOPATH ] ; then
    export PATH="$GOPATH:$PATH"
fi

export PROTOC_PATH="$HOME/.protoc/protoc-27.2-linux-x86_64/bin"
if [ -d $PROTOC_PATH ]; then
    export PATH="$PROTOC_PATH:$PATH"
fi

export NGROK_PATH="$HOME/.ngrok"
if [ -d $NGROK_PATH ] ; then
    export PATH="$NGROK_PATH:$PATH"
fi

if command -v terraform &> /dev/null
then
    alias tf=terraform
    complete -C "$(readlink -f terraform)" tf
    
    export TF_CLI_ARGS_plan='-parallelism=32'
    export TF_CLI_ARGS_apply='-parallelism=32'
fi

if command -v kubectl &> /dev/null
then
    source <(kubectl completion bash)
    
    alias k=kubectl
    complete -o default -F __start_kubectl k
fi

export KUBE_CONFIG_PATH="$HOME/.kube/config"

export KUBE_EDITOR="code -w"

export EDITOR="code -w"

export NUGET_CONCURRENCY_LIMIT=32

ulimit -n 8192

JetBrains Tools

Log into JetBrains account and download the Toolbox app. Extract files from the downloaded archive and run jetbrains-toolbox executable. Log into account in the Toolbox app.

Note: set Maximum Heap Size configuration parameter of JetBrains tools in the Toolbox app to either 8192 or 16384.

Increase Limit of Maximum Number of Open Files

sudo nano /etc/security/limits.conf
*               soft    nofile            8192
*               hard    nofile            16384

Increase Limit of Maximum Number of Open Sockets for NPM

npm -g config set maxsockets 32

Fonts

  • Copy a C:\Windows\Fonts directory to /usr/share/fonts/microsoft-fonts.
  • Download Google Fonts, extract and copy files to /usr/share/fonts/google-fonts.
  • Set appropriate font directories and files permissions and re-generate fonts cache.
    sudo chmod 644 /usr/share/fonts/microsoft-fonts/*
    sudo chmod 644 /usr/share/fonts/google-fonts/*
    fc-cache -fv
    fc-cache-32 -fv
    sudo dnf install gnome-tweaks
  • Run gnome-tweaks and configure font rendering settings under the Fonts section.
    • Hinting: Full.
    • Antialiasing: Subpixel.

Links

Todo List

  • kubectl installation
  • Docker installation (prefer Docker Engine to Docker Desktop unless Kubernetes cluster is required to run in Docker)
  • Chrome installation
  • Edge installation
  • Script to download Java and compare SHA256 hash sum

About

Fedora Linux configuration for .NET Development

Topics

Resources

Stars

Watchers

Forks