22

I am running PhpStorm on Linux Mint installed in /opt. PhpStorm is notifying me that there is an update available (8.0.3), but then it tells me it doesn't have write permission to apply the update, and that I should run it as a privileged user to update it.

If I run phpstorm.sh as root/sudo it asks for license info and looks as though it's running the installer rather than the program. PhpStorm is licensed when I run it from the desktop.

So how can I run updates?

Ally
  • 955
  • 1
  • 15
  • 33
  • 3
    You can always do **full manual update**: 1) download full PhpStorm 2) remove current one (just PhpStorm not the settings) 3) extract new one into that folder where previous version was installed (folder must be empty to prevent any possible conflicts) – LazyOne Feb 20 '15 at 16:19
  • 2
    As a supplement to LazyOne's note, you *should* always do a full manual update. Personally, I keep different installs and use symlinks to switch to a new install, so if there are any glitches, I can switch back to the old version – Noah Feb 20 '15 at 18:09
  • Hi, yea thanks for the replies. I have in the past done it manually, but under windows, it tells you there's an update, you click on it and it applies the update. Nice and simple. Under Linux it tells you there's an update, but then tells you it can't apply it. I'd like to just click on the notice and apply the update under Linux too, but how? – Ally Feb 21 '15 at 00:33

4 Answers4

34

I had the same issue and was able to change ownership of the PhpStorm folder to get it to work. Assuming your username is newownername and PhpStorm installation is located in /opt/phpstorm, the command should look like this:

chown -R newownername /opt/phpstorm

Note that you should change username and path to appropriate values.

Tim
  • 397
  • 3
  • 4
  • 4
    worked for me, with `sudo chown -R newownername PhpStorm-xxxx` – userfuser Jan 15 '16 at 23:51
  • who should be the "newownername" the user running the program? – luukvhoudt May 12 '16 at 16:14
  • 2
    @Fleuv Yes, so if your username is alpha and the path to your phpstorm installation is /opt/phpstorm the command should look like this: `sudo chown -R alpha /opt/phpstorm` – Marcin Lawniczak Aug 25 '16 at 09:05
  • Not the recommended way: [An incorrect solution is to change the program folder from root to user permission (don't do this)](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206601265-Fixed-PyCharm-automatic-update-fails-on-Linux-due-to-permissions), better go with https://stackoverflow.com/a/47705994/2311074 – Adam May 28 '21 at 07:49
  • "newusername" is you, as you are running PhpStorm as you so needs to match that user. do `whoami` on CLI and use that result – James Aug 03 '22 at 11:39
18

No need (and not recommended) to change the ownership or the permissions of the opt/phpstorm directory. In fact, the error message returned says exactly what you should do: run it as a privileged user to update it.

After exiting PHPStorm, you can run it as a privileged user using the following instructions

sudo updatedb && sudo locate phpstorm.sh
sudo /path/to/phpstorm.sh

The first instruction updates the locate database and returns the location of the phpstorm executable in your computer. Use the returned location as the path in the second instruction.

When starting PHPStorm as root, it will start with the default settings. It might even ask you if you want to apply your license... No need to change any of this: the default settings and running PHPStorm in evaluation mode will work just fine. After it starts, check for updates in the menu Help and apply them normally. PHPStorm might restart once again as root. Just close it once more and restart normally. When restarting as your user, you'll be given the ability to select your normal settings (usually stored in your user's directory: the path will be suggested). Accept and continue. PHPStorm will start with all your preferences and settings restored and properly upgraded.

If plugin updates are required, you can update them normally. No need to do it using root.

This solution is recommended by JetBrains. Changing the ownership or the permissions of the opt/phpstorm directory is not recommended and in fact pointed as incorrect by Jet Brains, as you can verify on their answer regarding the process of upgrading a similar product: Fixed: PyCharm automatic update fails on Linux due to permissions.

6

sudo chown -R $USER:$USER /opt/PhpStorm* , worked for me.

Pavan Yogi
  • 180
  • 2
  • 7
3

JetBrains are publishing their entire IDE portfolio as snaps, including PHPStorm. Snaps work on all supported versions of Ubuntu, including 14.04 and on Linux Mint 17.x and 18.x.

Some of the advantages of the JetBrains snaps are that they are always up to date, will automatically stay updated and are very easy to install.

To install PHPStorm in Ubuntu or Linux Mint:

sudo apt install snapd
sudo snap install phpstorm --classic
Spoody
  • 2,852
  • 1
  • 26
  • 36