Skip to content

Commit

Permalink
install from source: add support for Jammy Jellyfish
Browse files Browse the repository at this point in the history
The dotnet team recently added support for installing natively from Jammy feeds on
Ubuntu 22.04:

dotnet/core#7699

This unfortunately created problems with our current install from source
script, as it caused conflicts with
the packages.microsoft.com feed we use in the install from for Debian/Ubuntu.

This change modifies the Debian/Ubuntu dotnet install to install from
Jammy feeds for users on Ubuntu 22.04 and greater while continuing to use
the packages.microsoft.com feed for Debian and older Ubuntu versions.
  • Loading branch information
ldennington committed Aug 15, 2022
1 parent a9fcb46 commit e039779
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validate-install-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- test-install-from-source

jobs:
docker:
Expand Down
38 changes: 27 additions & 11 deletions src/linux/Packaging.Linux/install-from-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,38 @@ case "$distribution" in
$sudo_cmd apt update
install_shared_packages apt install

# add dotnet package repository/signing key
$sudo_cmd apt update && $sudo_cmd apt install wget -y
curl -LO https://packages.microsoft.com/config/"$distribution"/"$version"/packages-microsoft-prod.deb
$sudo_cmd dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
# For Ubuntu versions 22.04 (Jammy Jellyfish) and greater, we use the
# native Jammy feeds. For Debian and Ubuntu versions less than 22.04, we
# use the packages.microsoft.com feed.
normalizedVersion=$(echo $version | sed 's/\.//')
useMicrosoftFeed=true
if [ $distribution = ubuntu ] && [ $normalizedVersion -ge 2204 ]; then
useMicrosoftFeed=false
fi

if $useMicrosoftFeed; then
# add dotnet package repository/signing key
$sudo_cmd apt update && $sudo_cmd apt install wget -y
curl -LO https://packages.microsoft.com/config/"$distribution"/"$version"/packages-microsoft-prod.deb
$sudo_cmd dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

# proactively install tzdata to prevent prompts
export DEBIAN_FRONTEND=noninteractive
$sudo_cmd apt install -y --no-install-recommends tzdata
# proactively install tzdata to prevent prompts
export DEBIAN_FRONTEND=noninteractive
$sudo_cmd apt install -y --no-install-recommends tzdata
fi

# install dotnet packages and dependencies if needed
if [ -z "$(verify_existing_dotnet_installation)" ]; then
$sudo_cmd apt update
$sudo_cmd apt install apt-transport-https -y
$sudo_cmd apt update
$sudo_cmd apt install dotnet-sdk-6.0 dpkg-dev -y

if $useMicrosoftFeed; then
$sudo_cmd apt install apt-transport-https -y
$sudo_cmd apt update
$sudo_cmd apt install dotnet-sdk-6.0 dpkg-dev -y
else
$sudo_cmd apt install dotnet6
fi
fi
;;
linuxmint)
Expand Down

0 comments on commit e039779

Please sign in to comment.