52

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?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
emedentsii
  • 653
  • 1
  • 5
  • 9
  • 2
    Best way to update JetBrains apps is to use JetBrains Toolbox App. You can download it from official jetbrains page: https://www.jetbrains.com/toolbox/app/ – zsts Jul 27 '17 at 04:53

13 Answers13

36

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
HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
jonathan
  • 784
  • 1
  • 10
  • 27
  • 3
    Make that: `sudo chown -R yourusername:root /opt/pycharm_dir/` (trailing slash is important) – Scott Smith Jan 30 '18 at 04:49
  • 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! – Carlos A. Jimenez Holmquist Apr 14 '18 at 00:03
  • What do you do after `sudo chown -R yourusername:root /opt/pycharm_dir/`? – ITA Apr 25 '18 at 14:07
  • Upgrade from within Pycharm for newer releases, or download the tarball and upgrade from there, then follow the additional steps I've listed here. – jonathan Apr 25 '18 at 17:34
  • 4
    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. – Adrian W Sep 30 '18 at 17:48
  • @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. – jonathan Feb 05 '19 at 15:51
21

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

sunyata
  • 1,843
  • 5
  • 27
  • 41
Shan Valleru
  • 3,093
  • 1
  • 22
  • 21
  • 4
    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 Jul 14 '14 at 15:26
  • 8
    It looks like much of these are in ~/.Pycharm30 - which should be fine. This is the right way. – Danny Staple Jul 14 '14 at 15:28
  • 16
    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 May 22 '15 at 15:35
  • 1
    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. – ssoto Jul 26 '17 at 07:59
  • 1
    This is now available in current versions (2017.x). I have the current community edition and it updates automatically. Very painless. – Animesh Jul 27 '17 at 17:47
  • 1
    @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! – cwhisperer Sep 20 '17 at 05:47
  • 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. – mjkrause Jan 04 '19 at 20:32
12

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.

Community
  • 1
  • 1
Snehal Parmar
  • 5,453
  • 3
  • 35
  • 46
  • **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. – ijuneja Jun 16 '20 at 05:20
8

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

Adrian W
  • 4,563
  • 11
  • 38
  • 52
Cani
  • 1,129
  • 10
  • 14
  • 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 Jul 29 '17 at 06:58
6

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.

Community
  • 1
  • 1
kdbanman
  • 10,161
  • 10
  • 46
  • 78
3

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
Bob Gamble
  • 31
  • 1
3

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'...)

Kyle Baker
  • 3,424
  • 2
  • 23
  • 33
  • 1
    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. – Adrian W Jul 29 '17 at 07:46
2

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
liminspace
  • 128
  • 1
  • 7
2

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! :)

gisdude
  • 151
  • 4
1
$ 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

Kampai
  • 22,848
  • 21
  • 95
  • 95
  • 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. – kdbanman Sep 12 '16 at 16:50
1

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

empty
  • 5,194
  • 3
  • 32
  • 58
0

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
lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228
0

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.