Skip to content

Instantly share code, notes, and snippets.

@rkennesson
Created April 30, 2020 02:37
Show Gist options
  • Save rkennesson/ed9a8db7f856f1521e256ebb61bceabe to your computer and use it in GitHub Desktop.
Save rkennesson/ed9a8db7f856f1521e256ebb61bceabe to your computer and use it in GitHub Desktop.
PyCharm installation script
# Copyright (c) 2015 Jim Rybarski
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
version="4.5.3" # set this to the version you want to install
# We need sudo to do some stuff
if [[ $EUID -ne 0 ]]; then
echo "Please run as root."
exit 1
fi
# Install Java
apt-get update && apt-get install openjdk-7-jre --no-install-recommends
# Download Pycharm
if [ ! -f /tmp/pycharm.tar.gz ]; then
wget -O /tmp/pycharm.tar.gz "https://download.jetbrains.com/python/pycharm-community-$version.tar.gz"
fi
# Decompress Pycharm
tar -xf /tmp/pycharm.tar.gz --directory /opt
# Get rid of existing symlink that points to now-obsolete version
if [ -f /usr/bin/pycharm ]; then
rm /usr/bin/pycharm
fi
# Create a symlink. Now you can run pycharm on the command line and
# on the first run, it will create a start menu shortcut and such
ln -s "/opt/pycharm-community-$version/bin/pycharm.sh" /usr/bin/pycharm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment