Update PyCharm on Linux

LinuxPycharmUpdates

Linux Problem Overview


Could you please clarify to me correct way to update PyCharm on Linux?

Is it impossible to update PyCharm internally?

In help > check for update I can just download a new archive.

Should I remove previous folder with PyCharm and unpack new or I should another way for this?

Linux Solutions


Solution 1 - Linux

In-Application Patch Upgrade

From the 2017 versions onward, it is now possible to perform a seamless upgrade without being required to download a tarball. PyCharm will prompt you that an upgrade is available.

If you've installed under /opt, temporarily elevate privileges:

$ sudo chown -R yourusername:root /opt/pycharm_dir/

If selected, PyCharm will upgrade itself, and upon relaunching, should prompt you to import your previous config, file, which is typically found here:

~/.PyCharm201X.X/config

Once you're done, re-apply root privileges

$ sudo chown -R root:root /opt/pycharm_dir/

If Upgrading Using tarball

I recently upgraded from version 2017.2 to 2017.5, and did so using a tarball which I'd previously downloaded. It's also pretty simple:

  1. Extract tarball in preferred location
  2. Delete existing pycharm directory
  3. Launch and import config

The only snag which I found was after the upgrade, my desktop launcher was broken. If you do happen to face this, find the .desktop files, using a tool such locate:

$ sudo updatedb
$ locate *.desktop | grep -i pycharm

Output should be something like:

$ locate *.desktop | grep -i pycharm
/home/yourusername/.gnome/apps/jetbrains-pycharm.desktop
/home/yourusername/.local/share/applications/jetbrains-pycharm.desktop

Edit these lines to the affected .desktop files, if incorrect, to match your PyCharm path:

Icon=/opt/pycharm-201X.X.X/bin/pycharm.png
Exec="/opt/pycharm-201X.X.X/bin/pycharm.sh" %f

Solution 2 - Linux

On Linux, you have to delete the old pyCharm directory and start using the new package. There's no other way, at least for now.

When launching the new version you will be asked if you want to import config files. You can find the old config files in a (hidden) directory in your home folder. For example: ~/.PyCharm2016.2/config

Solution 3 - Linux

Try to run following from your terminal after going into the pycharm downloaded folder

    sudo ./pycharm.sh 

When you run the above it will ask about the update and also import setting from old version. Please refer to this link :

Stockoverflow link

The solution in the link worked for me.

Solution 4 - Linux

When PyCharm won't let you update due to missing privileges, you can temporarily add read and write privileges for other users to the PyCharm directory and its contents or change the owner of your PyCharm directory if every file already has read and write privileges for the file owner.

Assuming you've installed PyCharm in /opt/pycharm-professional like this:

drwxr-xr-x 10 root root 4096 May 11 17:12 pycharm-professional

This would be a away to accomplish it:

  1. Set the owner

    $ sudo chown -R yourusername:root /opt/pycharm-professional

  2. Start PyCharm

    $ sh /opt/pycharm-professional/bin/pycharm.sh

  3. Press Alt + H and Alt + C to check for updates and apply them.

  4. Close PyCharm and don't forget to reset the ownership!

    $ sudo chown -R root:root /opt/pycharm-professional

Solution 5 - Linux

I'll be updating from PyCharm Community 4.0.6 installed at ~/Environment/ to PyCharm Community 4.5 on Fedora 21. Change directories, release names, and version numbers to match your situation.

Adapted from the PyCharm download page install instructions:


Update

Copy the pycharm-*.tar.gz to the current PyCharm installation location (make sure you have rw permissions for that directory, mine is in ~/Environment/):

[you@localhost Downloads]$ mv pycharm-community-4.5.tar.gz ~/Environment/
[you@localhost Downloads]$ cd ~/Environment/
[you@localhost Environment]$ ls
pycharm-community-4.0.6  pycharm-community-4.5.tar.gz

Remove the old PyCharm installation:

[you@localhost Environment]$ rm -rf pycharm-community-4.0.6/
[you@localhost Environment]$ ls
pycharm-community-4.5.tar.gz

Unpack the pycharm-*.tar.gz:

[you@localhost Environment]$ tar xfz pycharm-*.tar.gz 
[you@localhost Environment]$ ls
pycharm-community-4.5  pycharm-community-4.5.tar.gz

Remove the pycharm-*.tar.gz to save disk space (optional):

[you@localhost Environment]$ rm pycharm-*.tar.gz 
[you@localhost Environment]$ ls
pycharm-community-4.5

Run

PyCharm on Linux doesn't need special installation or running any installation script. You should now be able to run PyCharm:

[you@localhost Environment]$ sh pycharm-community-4.5/bin/pycharm.sh

Mine fired right up, opened my projects, files, and settings just like they were before.

Maintenance

Once you've started PyCharm, you can recreate your desktop entry with a couple clicks.

There is likely a ~/.PyCharm40/ or ~/.PyCharm30/ directory in your home directory. I didn't need to change this.

Solution 6 - Linux

I didn't have to delete old copies. Haven't had to since I started using it. Here's what I do:

  • In $HOME/.local/share/applications/jetbrains-pycharm.desktop edit current version numbers
  • Log out and back in to see changes

Solution 7 - Linux

I would have added this as a comment on the accepted answer, but [did not have 50 points when I wrote this answer].

Exporting and Importing settings is very well implemented in pycharm, and is detailed here: https://www.jetbrains.com/help/idea/2016.1/exporting-and-importing-settings.html

So, just so this is a complete answer, the whole process to update pycharm and preserve settings was just:

  • unpack the new version (downloaded straight from their website) next to the old version
  • open old version
  • go to File -> Export Settings (Alt + F, E)
  • save file
  • cd into the new version of python's bin directory, e.g., <path/to/pycharm>/pycharm-<2016.0.1/your version here>/bin/ folder that contains pycharm.sh (you can use locate pycharm.sh to help you find this directory)
  • open the new version with sudo, sudo ./pycharm.sh
  • specify the directory you exported your settings.jar to

et voila.

(bonus: For pinning it to the unity launcher bar in ubuntu, I like to just rightclick its icon while running, and click 'lock to launcher'...)

Solution 8 - Linux

You need to run pycharm from root and try to update.

# sudo /opt/pycharm/bin/pycharm.sh

Help > Check for Update...

Update and restart

# sudo chmod +x /opt/pycharm/bin/pycharm.sh

Solution 9 - Linux

You cannot do this internally because a new verison of PyCharm requires a new installation. So you will need to download the newest version from their site. Henceforth, as stated in the "Install-Linux-tar.txt" (included in the download):

  • unpack the new version to a directory of your choosing (I used the archive mananger)
  • cd into the bin folder of the the unpacked files
  • run sudo ./pycharm.sh. You will be prompted to import your old settings or not.

PyCharm will take care of the rest. That's what they do! :)

Solution 10 - Linux

$ sudo apt-get update
$ sudo apt-get install pycharm

This worked for me (Sept 2015) updating to pycharm V 4.5.4 on Ubuntu 14.04

Solution 11 - Linux

As of PyCharm 2017.2.1 you can update from the IDE by clicking "Help|Check for Updates..."

Solution 12 - Linux

I found this link very useful, so I will sum up what I did to update PyCharm. First, you have to remove the PyCharm version you already have:

sudo apt-get remove pycharm

Now, you can install PyCharm using two different methods.

METHOD 1: using umake

Open a terminal and run the following commands. In case you don't have umake:

sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make

Now you can install either PyCharm Community Edition in Ubuntu or PyCharm Professional Edition:

# use pycharm instead of pycharm-professional for the Community Editionpycharm-professional
umake ide pycharm-professional 

If you want to remove PyCharm When it was installed using umake, you can run:

# use pycharm instead of pycharm-professional for the Community Edition
umake ide pycharm-professional

METHOD 2: using PPA

Open a terminal and run the following commands:

sudo add-apt-repository ppa:mystic-mirage/pycharm
sudo apt-get update
# use pycharm-community for the community edition
sudo apt-get install pycharm

In case you want to remove PyCharm installed via PPA:

# use pycharm-community for the Community Edition 
sudo apt-get remove pycharm

Solution 13 - Linux

If you have downloaded pycharm from flatpak. Close pycharm if it is running. then just open the terminal. the type this command: sudo flatpak update com.jetbrains.PyCharm-Community start pycharm and enjoy the new version.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionemedentsiiView Question on Stackoverflow
Solution 1 - LinuxjonathanView Answer on Stackoverflow
Solution 2 - LinuxShan ValleruView Answer on Stackoverflow
Solution 3 - LinuxSnehal ParmarView Answer on Stackoverflow
Solution 4 - LinuxCaniView Answer on Stackoverflow
Solution 5 - LinuxkdbanmanView Answer on Stackoverflow
Solution 6 - LinuxBob GambleView Answer on Stackoverflow
Solution 7 - LinuxKyle BakerView Answer on Stackoverflow
Solution 8 - LinuxliminspaceView Answer on Stackoverflow
Solution 9 - LinuxgisdudeView Answer on Stackoverflow
Solution 10 - LinuxGraeme GummowView Answer on Stackoverflow
Solution 11 - LinuxemptyView Answer on Stackoverflow
Solution 12 - LinuxlmiguelvargasfView Answer on Stackoverflow
Solution 13 - Linuxuser11348908View Answer on Stackoverflow