How to Install PyCharm on Linux Mint 21 or 20

To install PyCharm on Linux Mint 21 or the older stable release of Linux Mint 20, follow this guide designed specifically for you. JetBrains developed PyCharm, a renowned Integrated Development Environment (IDE) exclusive for Python developers. This IDE provides a suite of premier tools that enhance productivity and efficiency for developers.

Key Features of PyCharm:

  • Intelligent Code Assistance: PyCharm completes context-based code, suggesting code snippets or objects relevant to the current code context. It actively inspects your code for errors and inefficiencies, offering corrections before code execution.
  • Smart Code Navigation: With PyCharm, developers can swiftly navigate to any class, file, or symbol and traverse complex code hierarchies with visual ‘breadcrumbs’ aiding in understanding the code structure.
  • Version Control Integration: The IDE seamlessly integrates with various version control systems, including Git, SVN, and Mercurial, offering a unified interface for effortless version control management.
  • Testing and Debugging: PyCharm boasts a robust debugger and tester. The visual debugger allows developers to monitor the real-time performance of their code, facilitating efficient debugging and testing.
  • Database Tools: PyCharm includes a comprehensive database editor and a unique SQL transpiler, providing developers with the tools necessary for efficient database management and SQL transpilation.

Different editions of PyCharm are available to suit various needs. The Community Edition is free and meets the requirements of Python developers without financial constraints. In contrast, the Professional and Educational Editions, which are paid versions, offer extended features for web development, data science activities, and educational purposes.

The following guide provides detailed steps to install PyCharm on Linux Mint 21 or the older stable release of Linux Mint 20, equipping you to efficiently leverage PyCharm’s powerful features.

Install PyCharm on Linux Mint 21 or 20 via APT

Step 1: Update Linux Mint Before PyCharm Installation

Before we start the installation process, ensuring that your Linux Mint system’s local package database is up-to-date is crucial. This allows your system to access the latest available versions of the packages in the repositories of Linux Mint. To update the package database, execute the following command:

sudo apt update

Update the package database, then upgrade the system. This process updates all installed software packages on your system to their latest versions.

sudo apt upgrade

Step 2: Install Initial Packages For PyCharm on Linux Mint

Next, install the required packages: dirmngr, ca-certificates, software-properties-common, apt-transport-https, curl, and lsb-release. These packages enable repository management, file transfer, and the execution of various tasks.

Use the following command to install these packages:

sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl lsb-release -y

Step 3: Add JetBrain’s Personal Package Archive (PPA) on Linux Mint

Now, we are ready to add the JetBrains PPA to our system’s list of repositories. This will allow the APT tool to access PyCharm directly from JetBrains’ PPA.

To ensure the authenticity of the packages downloaded from JetBrains’ repository, we will import the GPG key. The GPG, short for GNU Privacy Guard, is a public-key cryptography implementation that enables secure communication. Importing the GPG key verifies that JetBrains genuinely provides the packages downloaded from the repository:

curl -s https://s3.eu-central-1.amazonaws.com/jetbrains-ppa/0xA6E8698A.pub.asc | gpg --dearmor | sudo tee /usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg > /dev/null

With the GPG key successfully imported, we can now add the JetBrains PPA to our system’s package sources:

echo "deb [signed-by=/usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg] http://jetbrains-ppa.s3-website.eu-central-1.amazonaws.com any main" | sudo tee /etc/apt/sources.list.d/jetbrains-ppa.list > /dev/null

Step 4: Refresh APT Index on Linux Mint After PyCharm PPA Import

Upon adding a new repository, updating our APT package database is essential. This will fetch the package information from the newly added JetBrains PPA:

sudo apt update

Step 5: Install PyCharm on Linux Mint 21 or 20 via APT Command

Prepare your system and meet all prerequisites before installing PyCharm. JetBrains PPA offers three PyCharm editions: Community, Education, and Professional. Most users prefer the free Community edition. However, the paid Education and Professional editions provide additional features.

Select the edition that suits your needs and use the command below for installation:

Community Edition:

sudo apt install pycharm-community

Education Edition:

sudo apt install pycharm-education

Professional Edition:

sudo apt install pycharm-professional

Install PyCharm on Linux Mint 21 or 20 via Flatpak and Flathub

Flatpak, a powerful package manager, provides an alternative for installing PyCharm IDE on Linux Mint. Contrary to common belief, Linux Mint systems include Flatpak by default. While Snaps and Flatpak compete, many other Linux distributions favor Flatpak for its maturity.

Step 1: Enable the Flathub For PyCharm on Linux Mint

Our initial step involves enabling Flathub, a large app store containing many Flatpak applications. Flathub is a user-friendly gateway that provides a wide range of applications packaged in the Flatpak format. To enable Flathub, we use the following command:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

In executing this command, you add the Flathub repository to your Flatpak environment. The --if-not-exists option ensures that if the Flathub repository is already present, the command will not return an error, thus making this operation idempotent.

Step 2: Install PyCharm on Linux Mint 21 or 20 via Flatpak Commands

Once we have Flathub enabled, we can proceed with installing PyCharm. At the time of writing, Flathub supports both the Community and Professional editions of PyCharm. You can choose the version that suits your needs best.

To install the Community Edition, execute the following command:

flatpak install flathub com.jetbrains.PyCharm-Community -y

For users who prefer the Professional Edition, use the following command:

flatpak install flathub com.jetbrains.PyCharm-Professional -y

Running PyCharm After Installation on Linux Mint 21 or 20

After successfully installing PyCharm Integrated Development Environment (IDE) on Linux Mint 21 or 20, you need to launch the program. You can initiate PyCharm using various methods, depending on your preferences or your Linux Mint system’s unique specifications.

CLI Methods to Launch PyCharm on Linux Mint

The terminal provides the most direct method to launch PyCharm. The exact command to run PyCharm may differ depending on your chosen installation method.

APT PyCharm launch commands:

If you’ve installed PyCharm via the APT package manager, the following commands correspond to the different editions:

Community Edition:

pycharm-community

Professional Edition:

pycharm-professional

Education Edition:

pycharm-educational

Flatpak PyCharm launch commands:

For users who opted for Flatpak for the installation, the following commands will launch the corresponding editions of PyCharm:

Community Edition:

flatpak run com.jetbrains.PyCharm-Community

Professional Edition:

flatpak run com.jetbrains.PyCharm-Professional

Launching PyCharm using the Graphical User Interface

While the command-line interface provides a quick and efficient method to start PyCharm, it may not always be the most convenient, depending on your preferences. You can initiate PyCharm through your Linux Mint system’s graphical user interface (GUI).

  1. Open the Taskbar of your desktop.
  2. Proceed to the Programming tab.
  3. Next, click PyCharm or initiate a search for “PyCharm” and select the specific edition you’ve installed.
Screenshot showing PyCharm application icons on Linux Mint 21 or 20 desktop, ready for launching.
Quick Access: PyCharm Application Icons on Linux Mint Desktop

Tips for Getting Started with PyCharm on Linux Mint 21 or 20

To help you make the most out of this tool, here are some practical tips on general usage, customizations, and other strategies to boost your programming efficiency in PyCharm.

General PyCharm Tips with Linux Mint

  • Understand the Editor Basics: The PyCharm editor is the primary workspace where you spend most of your time. Familiarizing with the editor’s basic functionalities, such as the different types of highlighting, line numbers, breadcrumbs, and indentation guidelines, will provide a smoother coding experience.
  • Master the Keyboard Shortcuts: PyCharm has many keyboard shortcuts to expedite your coding process. For instance, Ctrl+Space activates the code completion feature, Alt+Enter shows intentional actions and quick fixes, and Ctrl+/ comments or uncomments a line or a code block.
  • Use PyCharm’s Integrated Terminal: Instead of switching between windows, utilize PyCharm’s integrated terminal, which you can find at the bottom of the IDE. It shares the same environment variables with your system, so you can execute Python scripts and system commands without leaving PyCharm.
# Access PyCharm's terminal
Alt+F12

PyCharm Customization Tips with Linux Mint

  • Customize Your Theme: PyCharm allows you to adjust the theme of your IDE to match your visual preference. To change the theme, navigate to File -> Settings -> Appearance & Behavior -> Appearance and select your desired theme from the ‘Theme’ dropdown menu.
  • Adjust the Editor’s Font and Size: If you’re uncomfortable with the default font or its size in the editor, you can change it by going to File -> Settings -> Editor -> Font. This customization can enhance readability and reduce eye strain during prolonged coding sessions.
  • Manage Your Plugins: PyCharm Community Edition supports various plugins to augment your IDE’s capabilities. Add, remove, or disable plugins through File -> Settings -> Plugins. Be mindful only to install the plugins to keep your IDE light and responsive.

Other PyCharm Tips with Linux Mint

  • Debugging: PyCharm comes with a powerful debugging tool. Use breakpoints (click on the space next to the line number) to inspect your code. Use the Debug option (Shift+F9) to start a debug session. This tool can significantly reduce the time spent on finding and fixing bugs.
  • Version Control Integration: If you’re using Git or any other version control system, PyCharm can integrate and provide a user-friendly interface for most version control tasks. This feature can be found under VCS -> Enable Version Control Integration…
  • Code Inspection: PyCharm offers robust code inspection capabilities. It automatically checks your code for errors and provides quick-fix solutions. To manually inspect your code, go to Code -> Inspect Code… This is an excellent way to ensure your code adheres to the best coding practices.

Incorporating these tips into your PyCharm usage can significantly enhance your development workflow, enabling you to utilize this powerful Python IDE’s potential fully.

Screenshot of the default PyCharm Community Edition UI on Linux Mint 21 or 20, open and ready to start a new project.
Starting Point: PyCharm Community Edition’s New Project UI on Linux Mint

Additional PyCharm Management Commands with Linux Mint 21 or 20

Upon successfully installing and using PyCharm on your Linux Mint system, circumstances may arise where you need to update the IDE or altogether remove it from your system. This section dives deeper into the procedures associated with updating and uninstalling PyCharm on Linux Mint.

Update PyCharm on Linux Mint 21 or 20

Updating your PyCharm IDE ensures you can use new features, improvements, and vital bug fixes. The command to update your PyCharm installation depends on the third-party package manager you initially used to install it.

APT Method to Update PyCharm on Linux Mint

If your choice for PyCharm installation was the APT package manager, execute the following commands in your terminal:

sudo apt update
sudo apt upgrade

Running these commands will scan for updates for all the applications on your system installed via APT, including PyCharm.

Flatpak Method to Update PyCharm on Linux Mint

For those who opted for Flatpak for the installation, updating PyCharm is a straightforward process. Execute the following command in your terminal:

sudo flatpak update

Remove PyCharm from Linux Mint 21 or 20

There might be situations where you no longer need PyCharm on your system. You can uninstall it using the corresponding commands based on your initial installation method.

APT Method to Remove PyCharm from Linux Mint

If you utilized the APT package manager to install PyCharm, you can uninstall it by entering the following commands in your terminal that match your installed version:

sudo apt remove pycharm-community
sudo apt remove pycharm-professional
sudo apt remove pycharm-education

In addition, if you have no plans to reinstall PyCharm or use the JetBrains PPA for other products, you can remove the repository and its GPG key with these commands:

sudo rm /etc/apt/sources.list.d/jetbrains-ppa.list
sudo rm /usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg

Flatpak Method to Remove PyCharm from Linux Mint

If you installed PyCharm via Flatpak, use the following commands to uninstall the IDE that matches your installed version:

flatpak uninstall --delete-data com.jetbrains.PyCharm-Community
flatpak uninstall --delete-data com.jetbrains.PyCharm-Professional

With these procedures, managing your PyCharm installation on Linux Mint becomes straightforward, helping you keep your system organized and your IDE up-to-date.

Closing Points and Recap

Successfully installing and managing PyCharm on Linux Mint brings a powerful and feature-rich IDE to your fingertips. The in-depth procedures detailed in this article guide you through installing, launching, and managing PyCharm on Linux Mint using the APT and Flatpak package managers. Armed with this information, you can confidently maintain your PyCharm installation, keeping it updated and, when necessary, completely removing it from your system.

Your Mastodon Instance
Share to...