Last active
June 25, 2020 22:14
-
-
Save adujardin/26dd9af7031d5f106794fd6d01cca90f to your computer and use it in GitHub Desktop.
Update cmake Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
# https://apt.kitware.com/ | |
if [ -n "$(uname -a | grep Ubuntu)" ]; then | |
apt-get update ; apt-get install lsb-release apt-transport-https ca-certificates gnupg software-properties-common wget -y | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - | |
codename=`lsb_release --codename | cut -f2` | |
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ '$codename' main' | |
apt-get install kitware-archive-keyring | |
apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA | |
apt-get install cmake | |
else | |
echo "This script is only meant for Ubuntu" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment