我该如何修复我的 pycharm 安装?

我该如何修复我的 pycharm 安装?

我之前安装了 pycharm,可以从 dash 启动它,只需输入 pyc...,图标就会出现。现在我下载了新版本的 pycharm,我想知道应该怎么做才能让它取代旧版本?我启动 4.5 pycharm 的方式是

~/Downloads/pycharm-4.5/bin/pycharm.sh &

但我仍然安装了旧的 4.0,如果我从仪表盘启动它,它就会启动。我该如何修复安装,以便 4.5 可以从仪表盘运行?

$ sudo lsof | grep pycharm
[sudo] password for dac: 
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1002/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
pycharm.s 29590              dac  cwd       DIR              252,4       4096    1713357 /home/dac
pycharm.s 29590              dac  rtd       DIR              252,4       4096          2 /
pycharm.s 29590              dac  txt       REG              252,4     121272   12320800 /bin/dash
pycharm.s 29590              dac  mem       REG              252,4    1840928     268013 /lib/x86_64-linux-gnu/libc-2.19.so
pycharm.s 29590              dac  mem       REG              252,4     149120     268007 /lib/x86_64-linux-gnu/ld-2.19.so
pycharm.s 29590              dac    0u      CHR             136,36        0t0         39 /dev/pts/36
pycharm.s 29590              dac    1u      CHR             136,36        0t0         39 /dev/pts/36
pycharm.s 29590              dac    2u      CHR             136,36        0t0         39 /dev/pts/36
pycharm.s 29590              dac   10r      REG              252,4       6872    6029516 /home/dac/Downloads/pycharm-4.0.6/bin/pycharm.sh
java      29639              dac  mem       REG              252,4       5293    6425588 /home/dac/Downloads/pycharm-4.0.6/plugins/python-gherkin/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       1155    6425610 /home/dac/Downloads/pycharm-4.0.6/plugins/restClient/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       2124    6425560 /home/dac/Downloads/pycharm-4.0.6/plugins/htmltools/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       2178    6425623 /home/dac/Downloads/pycharm-4.0.6/plugins/stylus/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       6768    6425619 /home/dac/Downloads/pycharm-4.0.6/plugins/sass/lib/resources_en.jar
java      29639              dac  mem       REG              252,4    5184333    6425468 /home/dac/Downloads/pycharm-4.0.6/plugins/CSS/lib/css.jar
java      29639              dac  mem       REG              252,4    1567763    6425665 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/tasks-core.jar
java      29639              dac  mem       REG              252,4     389654    6425690 /home/dac/Downloads/pycharm-4.0.6/plugins/uml/lib/diagram-api.jar
java      29639              dac  mem       REG              252,4     670202    6425691 /home/dac/Downloads/pycharm-4.0.6/plugins/uml/lib/uml-support.jar
java      29639              dac  mem       REG              252,4    1602417    6425618 /home/dac/Downloads/pycharm-4.0.6/plugins/sass/lib/jrubyparser-0.5.4.jar
java      29639              dac  mem       REG              252,4       1584    6425614 /home/dac/Downloads/pycharm-4.0.6/plugins/rest/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       4158    6425577 /home/dac/Downloads/pycharm-4.0.6/plugins/less/lib/resources_en.jar
java      29639              dac  mem       REG              252,4      95612    6425570 /home/dac/Downloads/pycharm-4.0.6/plugins/ipnb/lib/java_websocket.jar
java      29639              dac  mem       REG              252,4     109043    6425568 /home/dac/Downloads/pycharm-4.0.6/plugins/ipnb/lib/commons-io-1.4.jar
java      29639              dac  mem       REG              252,4    3318083    6425567 /home/dac/Downloads/pycharm-4.0.6/plugins/ipnb/lib/batik.jar
java      29639              dac  mem       REG              252,4     373765    6425572 /home/dac/Downloads/pycharm-4.0.6/plugins/ipnb/lib/snuggletex-core-1.3-SNAPSHOT.jar
java      29639              dac  mem       REG              252,4     517073    6425573 /home/dac/Downloads/pycharm-4.0.6/plugins/ipnb/lib/xmlgraphics-commons-1.3.1.jar
java      29639              dac  mem       REG              252,4     501079    6425571 /home/dac/Downloads/pycharm-4.0.6/plugins/ipnb/lib/jeuclid-core-3.1.9.jar
java      29639              dac  mem       REG              252,4       2181    6425552 /home/dac/Downloads/pycharm-4.0.6/plugins/haml/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       7854    6425518 /home/dac/Downloads/pycharm-4.0.6/plugins/coffeescript/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       6760    6425522 /home/dac/Downloads/pycharm-4.0.6/plugins/cucumber/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       2309    6425564 /home/dac/Downloads/pycharm-4.0.6/plugins/ini4idea/lib/resources_en.jar
java      29639              dac  mem       REG              252,4       2639    6425584 /home/dac/Downloads/pycharm-4.0.6/plugins/puppet/lib/resources_en.jar
java      29639              dac  mem       REG              252,4        929    6425695 /home/dac/Downloads/pycharm-4.0.6/plugins/vagrant/lib/resources_en.jar
java      29639              dac  mem       REG              252,4    1597978    6425694 /home/dac/Downloads/pycharm-4.0.6/plugins/vagrant/lib/jrubyparser-0.5.3.jar
java      29639              dac  mem       REG              252,4       6545    6425496 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptDebugger/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     264894    6425494 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptDebugger/lib/FirefoxConnector.jar
java      29639              dac  mem       REG              252,4    2520745    6425493 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptDebugger/lib/ChromeConnector.jar
java      29639              dac  mem       REG              252,4     252004    6425506 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptLanguage/lib/ecmascript6-compiler.jar
java      29639              dac  mem       REG              252,4     194328    6425507 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptLanguage/lib/javascript-openapi.jar
java      29639              dac  mem       REG              252,4     191349    6425509 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptLanguage/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     310417    6425508 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptLanguage/lib/js-test-common.jar
java      29639              dac  mem       REG              252,4       8894    6425556 /home/dac/Downloads/pycharm-4.0.6/plugins/hg4idea/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     309687    6425661 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/jira.jar
java      29639              dac  mem       REG              252,4     113174    6425666 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/wsdl4j-1.4.jar
java      29639              dac  mem       REG              252,4      55767    6425662 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/json-path-0.8.0.jar
java      29639              dac  mem       REG              252,4      51483    6425663 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/json-smart-1.1.1.jar
java      29639              dac  mem       REG              252,4    1599570    6425657 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/axis-1.4.jar
java      29639              dac  mem       REG              252,4      31191    6425658 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/axis-jaxrpc-1.4.jar
java      29639              dac  mem       REG              252,4      76685    6425660 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/commons-discovery-0.4.jar
java      29639              dac  mem       REG              252,4      19419    6425659 /home/dac/Downloads/pycharm-4.0.6/plugins/tasks/lib/axis-saaj-1.3.jar
java      29639              dac  mem       REG              252,4      43074    6425469 /home/dac/Downloads/pycharm-4.0.6/plugins/CSS/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     262248    6425467 /home/dac/Downloads/pycharm-4.0.6/plugins/CSS/lib/css-openapi.jar
java      29639              dac  mem       REG              252,4       3662    6425537 /home/dac/Downloads/pycharm-4.0.6/plugins/fileWatcher/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     579670    6425473 /home/dac/Downloads/pycharm-4.0.6/plugins/DatabaseTools/lib/database-openapi.jar
java      29639              dac  mem       REG              252,4    2272561    6425475 /home/dac/Downloads/pycharm-4.0.6/plugins/DatabaseTools/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     214691    6425474 /home/dac/Downloads/pycharm-4.0.6/plugins/DatabaseTools/lib/jdbc-console.jar
java      29639              dac  mem       REG              252,4     250159    6425653 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/trilead.jar
java      29639              dac  mem       REG              252,4     166186    6425651 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/svnkit-javahl16.zip
java      29639              dac  mem       REG              252,4      43354    6425645 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     506530    6425654 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/trileadsrc.zip
java      29639              dac  mem       REG              252,4     164368    6425642 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/antlr.jar
java      29639              dac  mem       REG              252,4     757959    6425647 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/sqljet.jar
java      29639              dac  mem       REG              252,4       3822    6425644 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/jsch.agentproxy.svnkit-trilead-ssh2.jar
java      29639              dac  mem       REG              252,4      70637    6425646 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/sequence-library.jar
java      29639              dac  mem       REG              252,4     457368    6425648 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/sqljetsrc.zip
java      29639              dac  mem       REG              252,4    3382277    6425652 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/svnkit.jar
java      29639              dac  mem       REG              252,4     330711    6425650 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/svnkit-javahl.jar
java      29639              dac  mem       REG              252,4     252914    6425545 /home/dac/Downloads/pycharm-4.0.6/plugins/git4idea/lib/trilead-ssh2.jar
java      29639              dac  mem       REG              252,4      64455    6425540 /home/dac/Downloads/pycharm-4.0.6/plugins/git4idea/lib/git4idea-rt.jar
java      29639              dac  mem       REG              252,4      29198    6425544 /home/dac/Downloads/pycharm-4.0.6/plugins/git4idea/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     143195    6425543 /home/dac/Downloads/pycharm-4.0.6/plugins/git4idea/lib/remote-servers-git.jar
java      29639              dac  mem       REG              252,4     105423    6425542 /home/dac/Downloads/pycharm-4.0.6/plugins/git4idea/lib/ini4j-0.5.2-patched.jar
java      29639              dac  mem       REG              252,4     248711    6425530 /home/dac/Downloads/pycharm-4.0.6/plugins/cvsIntegration/lib/trilead-ssh2-build213.jar
java      29639              dac  mem       REG              252,4      30201    6425528 /home/dac/Downloads/pycharm-4.0.6/plugins/cvsIntegration/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     553833    6425527 /home/dac/Downloads/pycharm-4.0.6/plugins/cvsIntegration/lib/javacvs-src.jar
java      29639              dac  mem       REG              252,4     101007    6425529 /home/dac/Downloads/pycharm-4.0.6/plugins/cvsIntegration/lib/smartcvs-src.jar
java      29639              dac  mem       REG              252,4     182567    6425526 /home/dac/Downloads/pycharm-4.0.6/plugins/cvsIntegration/lib/cvs_util.jar
java      29639              dac  mem       REG              252,4     186214    6425675 /home/dac/Downloads/pycharm-4.0.6/plugins/textmate/lib/joni.jar
java      29639              dac  mem       REG              252,4    1258043    6425674 /home/dac/Downloads/pycharm-4.0.6/plugins/textmate/lib/jcodings.jar
java      29639              dac  mem       REG              252,4       8367    6425606 /home/dac/Downloads/pycharm-4.0.6/plugins/remote-run/lib/jediterm-ssh-connector-2.0.jar
java      29639              dac  mem       REG              252,4     232908    6425669 /home/dac/Downloads/pycharm-4.0.6/plugins/terminal/lib/jediterm-pty-2.0.jar
java      29639              dac  mem       REG              252,4     432754    6425699 /home/dac/Downloads/pycharm-4.0.6/plugins/webDeployment/lib/commons-vfs2-2.1-SNAPSHOT.jar
java      29639              dac  mem       REG              252,4      33650    6425700 /home/dac/Downloads/pycharm-4.0.6/plugins/webDeployment/lib/resources_en.jar
java      29639              dac  mem       REG              252,4      59684    6425513 /home/dac/Downloads/pycharm-4.0.6/plugins/PerforceIntegration/lib/perforce_util.jar
java      29639              dac  mem       REG              252,4      12267    6425514 /home/dac/Downloads/pycharm-4.0.6/plugins/PerforceIntegration/lib/resources_en.jar
java      29639              dac  mem       REG              252,4     493911    6425536 /home/dac/Downloads/pycharm-4.0.6/plugins/fileWatcher/lib/fileWatcher.jar
java      29639              dac  mem       REG              252,4     157987    6425597 /home/dac/Downloads/pycharm-4.0.6/plugins/python-remote-interpreter/lib/python-remote-interpreter.jar
java      29639              dac  mem       REG              252,4     545696    6425576 /home/dac/Downloads/pycharm-4.0.6/plugins/less/lib/less.jar
java      29639              dac  mem       REG              252,4    2117726    6425525 /home/dac/Downloads/pycharm-4.0.6/plugins/cvsIntegration/lib/cvsIntegration.jar
java      29639              dac  mem       REG              252,4    5144371    6425649 /home/dac/Downloads/pycharm-4.0.6/plugins/svn4idea/lib/svn4idea.jar
java      29639              dac  mem       REG              252,4       8545    6425591 /home/dac/Downloads/pycharm-4.0.6/plugins/python-javascript-debugger/lib/python-javascript-debugger.jar
java      29639              dac  mem       REG              252,4    2865691    6425620 /home/dac/Downloads/pycharm-4.0.6/plugins/sass/lib/sass.jar
java      29639              dac  mem       REG              252,4      16592    6425533 /home/dac/Downloads/pycharm-4.0.6/plugins/django-db-config/lib/django-db-config.jar
java      29639              dac  mem       REG              252,4    1380871    6425583 /home/dac/Downloads/pycharm-4.0.6/plugins/puppet/lib/puppet.jar
java      29639              dac  mem       REG              252,4     881648    6425495 /home/dac/Downloads/pycharm-4.0.6/plugins/JavaScriptDebugger/lib/JavaScriptDebugger.jar
java      29639              dac  mem       REG              252,4     476810    6425607 /home/dac/Downloads/pycharm-4.0.6/plugins/remote-run/lib/remote-run.jar
java      29639              dac  mem       REG              252,4    2902960    6425541 /home/dac/Downloads/pycharm-4.0.6/plugins/git4idea/lib/git4idea.jar
java      29639              dac  mem       REG              252,4    2033724    6425512 /home/dac/Downloads/pycharm-4.0.6/plugins/PerforceIntegration/lib/PerforceIntegration.jar
java      29639              dac  mem       REG              252,4     251336    6425611 /home/dac/Downloads/pycharm-4.0.6/plugins/restClient/lib/restClient.jar
java      29639              dac  mem       REG              252,4     444150

答案1

准备 PyCharm 4.5

移动安装:

sudo mv -r ~/Downloads/pycharm-4.5 /opt/pycharm-4.5

在中创建新文件~/.local/share/applications/

nano ~/.local/share/applications/pycharm.desktop

并添加以下内容

[Desktop Entry]
Type=Application
Name=PyCharm
Comment=The Most Intelligent Python IDE
Icon=pycharm
Exec=/opt/pycharm-4.5/bin/pycharm.sh
Terminal=false
Categories=Development;IDE;Python;
StartupWMClass=PyCharm

如果图标不起作用(图标主题中没有匹配的图标),则替换条目

Icon=pycharm

Icon=/opt/pycharm-4.5/bin/pycharm.png

删除 PyCharm 4.0

在你的情况下,PyCharm 4.0 安装在 中~/Downloads/pycharm-4.0.6/。因此使用以下命令删除该文件夹:

rm -r ~/Downloads/pycharm-4.0.6

现在我们可以搜索.desktopPyCharm 4.0 的文件:

grep -rnw ~/.local/share/applications -e ".*pycharm.sh.*"
grep -rnw /usr/share/applications -e ".*pycharm.sh.*"

如果有这样的条目(笔记pycharm-4.0.6) Exec=…:

/usr/share/applications/pycharm.desktop:6:Exec=/home/<your_username>/Downloads/pycharm-4.0.6/bin/pycharm.sh

删除:

sudo rm /usr/share/applications/pycharm.desktop

答案2

回答这个问题,你只需要一个包含.desktop有关你的 PyCharm 可执行文件的一般信息及其可执行文件的引用的文件。

这个答案.desktop给出了PyCharm 文件的示例;这个答案显示放置文件的路径.desktop

请记住,您可能需要设置您的Name=字段以包含您的 PyCharm 的版本,即Name="PyCharm 4.5",因为您的系统中存在另一个版本的 PyCharm,并且可能很难区分它们。

答案3

比其他答案更简单的方法。无需.desktop亲自创建文件,加载程序后即可转到Tools > Create Desktop Entry。现在您可以从启动器运行它。

相关内容