2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
2023-11-22 21:49:23 +01:00
|
|
|
## File: install-mono.sh
|
|
|
|
|
## Desc: Install Mono
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
|
2023-12-29 12:36:27 +01:00
|
|
|
# Source the helpers for use with the script
|
2022-07-25 13:26:39 +04:00
|
|
|
source $HELPER_SCRIPTS/os.sh
|
|
|
|
|
|
2023-12-29 12:36:27 +01:00
|
|
|
os_label=$(lsb_release -cs)
|
2023-12-29 18:11:55 +01:00
|
|
|
REPO_URL="https://download.mono-project.com/repo/ubuntu"
|
|
|
|
|
GPG_KEY="/usr/share/keyrings/mono-official-stable.gpg"
|
|
|
|
|
REPO_PATH="/etc/apt/sources.list.d/mono-official-stable.list"
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2022-07-25 13:26:39 +04:00
|
|
|
# There are no packages for Ubuntu 22 in the repo, but developers confirmed that packages from Ubuntu 20 should work
|
2023-12-26 12:50:52 +01:00
|
|
|
if is_ubuntu22; then
|
2023-12-29 12:36:27 +01:00
|
|
|
os_label="focal"
|
2022-07-25 13:26:39 +04:00
|
|
|
fi
|
|
|
|
|
|
2023-12-29 18:11:55 +01:00
|
|
|
# Install Mono repo
|
|
|
|
|
curl -fsSL https://download.mono-project.com/repo/xamarin.gpg | gpg --dearmor -o $GPG_KEY
|
|
|
|
|
echo "deb [signed-by=$GPG_KEY] $REPO_URL stable-$os_label main" > $REPO_PATH
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2023-12-29 18:11:55 +01:00
|
|
|
# Install Mono
|
2019-12-13 09:48:00 -05:00
|
|
|
apt-get update
|
2024-05-29 13:43:07 +02:00
|
|
|
apt-get install --no-install-recommends apt-transport-https mono-complete nuget
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2023-12-29 18:11:55 +01:00
|
|
|
# Remove Mono's apt repo
|
|
|
|
|
rm $REPO_PATH
|
|
|
|
|
rm -f "${REPO_PATH}.save"
|
|
|
|
|
rm $GPG_KEY
|
2023-12-29 12:36:27 +01:00
|
|
|
|
2023-12-29 18:11:55 +01:00
|
|
|
# Document source repo
|
2023-12-29 12:36:27 +01:00
|
|
|
echo "mono https://download.mono-project.com/repo/ubuntu stable-$os_label main" >> $HELPER_SCRIPTS/apt-sources.txt
|
2021-05-21 12:34:41 +05:00
|
|
|
|
2020-12-29 10:02:46 +03:00
|
|
|
invoke_tests "Tools" "Mono"
|