Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Update phpstorm on Ubuntu linux.
#!/bin/bash -e
# IMPORTANT. My phpstom installation exists on /opt/phpstorm.
# Early Access program:
# SUDO? @source
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
echo -n "Please enter the PhpStorm download url (eg "
read url
# Download file from url
echo "Downloading PhpStorm to ~/Desktop"
cd ~/Desktop
wget ${url} --no-check-certificate
tar -xzf ~/Desktop/PhpStorm*
rm ~/Desktop/PhpStorm*
# Remove old Phpstorm
echo "Removing old PhpStorm"
rm -rf /opt/phpstorm
# Copy new Phpstorm
echo "Copying new PhpStorm"
mv ~/Desktop/PhpStorm* /opt/phpstorm
# Finish
echo "New PhpStorm has been installed!"
#Run phpStorm
echo "starting PhpStorm"
runuser -l $SUDO_USER -c"bash /opt/phpstorm/bin/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.