Update PyCharm on Linux

44,878

Solution 1

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

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

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

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

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.

Share:
44,878
emedentsii
Author by

emedentsii

Software QA, python enthusiast and big Linux fan =)

Updated on October 24, 2020

Comments

  • emedentsii
    emedentsii over 3 years

    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?

  • Danny Staple
    Danny Staple almost 10 years
    Is there no way to preserve previous app settings and plugins? Any files that should be excluded or copied out and back in?
  • Danny Staple
    Danny Staple almost 10 years
    It looks like much of these are in ~/.Pycharm30 - which should be fine. This is the right way.
  • kdbanman
    kdbanman almost 9 years
    This is pretty disappointing. PyCharm and every other JetBrains product I've used are remarkably feature complete and easy to use. This delete-and-reinstall update method is remarkably clunky. Maybe @CrazyCoder could offer some insight.
  • kdbanman
    kdbanman over 7 years
    Very glad this works now! apt-get is definitely my preferred way of installing most things. Note that this will only update pycharm if it was originally installed through apt-get. Otherwise this will just install a second copy.
  • ssoto
    ssoto almost 7 years
    Sorry but this is not correct. Pycharm tar.gz file has an Install-Linux-tar.txt where an explanation is gived about how tu update between versions.
  • Animesh
    Animesh almost 7 years
    This is now available in current versions (2017.x). I have the current community edition and it updates automatically. Very painless.
  • Adrian W
    Adrian W almost 7 years
    Didn't work for me. Checking for updates as described will just offer a "Download" button which sends you to JetBrain's download page, which will bring you a plain .tar.gz and nothing else.
  • Adrian W
    Adrian W almost 7 years
    At least with recent versions of PyCharm, this is not necessary. Just extract the new version, start it and it will automatically ask to import the settings and will even propose the location of the previous version's settings as default.
  • cwhisperer
    cwhisperer over 6 years
    @ssoto was right: delete old pycharm folder, unpack new downloaded pycharm. Go into bin/ folder and run ./pyCharm.sh. Previous settings are detected and installed. That's all!
  • Scott Smith
    Scott Smith over 6 years
    Make that: sudo chown -R yourusername:root /opt/pycharm_dir/ (trailing slash is important)
  • Carlos A. Jimenez Holmquist
    Carlos A. Jimenez Holmquist about 6 years
    omg this had been bugging me for a while now, 'couse I had a 2016 version and wanted to update to the newest one, but always lost my desktop launcher, thank you!
  • ITA
    ITA about 6 years
    What do you do after sudo chown -R yourusername:root /opt/pycharm_dir/?
  • jonathan
    jonathan about 6 years
    Upgrade from within Pycharm for newer releases, or download the tarball and upgrade from there, then follow the additional steps I've listed here.
  • Adrian W
    Adrian W over 5 years
    If I choose "Help" -> "Check for updates..." in PyCharm 2018.2, it offers only the options "Download", "Release notes", "Ignore this update" and "Remind me later". "Download" opens the browser for Jetbrain's download page. I don't see any means for upgrading in-application. And yes, the permissions of /opt/pycharm-2018.2 are set according to your answer.
  • mjkrause
    mjkrause over 5 years
    On Ubuntu 16: Upgraded from 2017.1.1, which I installed using the tarball, to 2018.3.2 (both CE) by running sudo snap install pycharm-community --classic. It asks whether I want to import settings from the existing installation, which I did. Everything worked, well, like a charm... It created .PyCharmCE2018.3 in home.
  • jonathan
    jonathan about 5 years
    @AdrianW it appears that it depends on the upgrade path. I performed an update (i.e. a patch upgrade) from 2018.3.1 to 2018.3.4 today, and wasn't forced to download a separate install. major upgrades appear to still require the above process with a tar file download.
  • ijuneja
    ijuneja almost 4 years
    Extracting from tarball What worked for me was even simpler, run sudo ./pycharm.sh after navigating to the bin folder of the new version. Once the new version opens, navigate to Tools -> Create Desktop Entry. The desktop launcher was now linked to the new version automatically.