How to Install Jetbrains CLion IDE on Ubuntu 20.04

CLion is a fully Integrated Development Environment(IDE) for coding in C and C++ on Microsoft Windows, Linux, and macOS.

It’s packed with an in-depth code analyzer, a range of code generation options, and the ability to navigate to anywhere in your code in one click.

CLion understands modern C++ standards and provides preprocessor support. It also integrates with GDB/LLDB and a set of unit testing frameworks.

It will enhance your productivity with a smart editor, code quality assurance, automated refactorings and deep integration with the CMake build system.

CLion is designed for native cross-platform development in C and C++, as well as Kotlin/Native, Rust and Swift. It also provides essential support for CMake language, Python, popular web technologies (like JavaScript, XML, HTML, Markdown and others), and this also includes support for all the other languages that are available through bundled and repository plugins.

Key Features of CLion IDE:

  • Navigation & Search: Find your way through the code with instant navigation to a symbol, class or file. Inspect the calls or types hierarchy and easily search everywhere for nearly everything including IDE settings.
  • Run and Debug: Build, Run and Debug your application and unit tests locally or remotely in CLion. Use the debugger UI with GDB or LLDB as a backend.
  • Access the command line through the built-in terminal, switch on Vim-emulation mode together with the Vim key bindings, or expand the IDE’s functionality with other various plugins.
  • Select one of the default editor themes or customize them to match your personal preferences. Adopt the keyboard-centric approach and select a keymap you prefer the most, or create your own easily.
  • Smart editor: With an IDE that analyzes the context and understands your project, you can code faster than you think. Try smart completion, formatting and helpful views with code insight.
  • Code documentation: With CLion keep your code documented with ease.
  • Write beautiful and correct code with CLion. Static analysis for all supported languages highlights warnings and errors in the code immediately as you type and suggests quick-fixes.
  • Many more…

Refer official documentation for more information.

Basic system requirements for CLion:

These are the minimum system requirements for installing CLion on a Linux System.

  • RAM: 2 GB of Free RAM minimum, 8 GB of total system RAM (Recommended)
  • CPU: Any modern CPU, Multi-core CPU. CLion supports multithreading for different operations and processes making it faster the more CPU cores it can use.
  • Disk space: 2.5 GB and another 1 GB for caches, SSD drive with at least 5 GB of free space (Recommended).
  • Monitor resolution: 1024×768, 1920×1080 (Recommended)
  • GNOME or KDE desktop

Note: You do not need to install Java to run CLion because JetBrains Runtime is bundled with the IDE (based on JRE 11).

But if necessary you can follow the below steps to install Java:

Installing Java

Type the following command to check whether Java is already installed on your system.

$ java -version

You can skip this step if Java is already installed, and if Java is not installed then follow the steps below.

In this tutorial I will install OpenJDK 11 and the installation is pretty straightforward.

First update the package index and then Install the OpenJDK 11 package by typing the following command.

$ sudo apt update && sudo apt install openjdk-11-jdk

This article explains two methods of installing CLion IDE on Ubuntu 20.04.

Choose the installation method that is most appropriate for your environment.

Method 1: Installing CLion as a Snap Package

The easiest way to install CLion on Ubuntu 20.04 is by using the snap packaging system.

CLion snap package is distributed and maintained by JetBrain.

A snap package is a type of universal Linux package that you can enjoy irrespective of the distro. Its an self-contained software packages that include the binary all dependencies needed to run the application.

All you need is the snap service pre-configured, In the case of Ubuntu 20.04, it comes with snap pre-installed.

If snapd package is not already installed then you can install it by running following command.

$ sudo apt install snapd

Note: Snap packages can be installed from either the command-line or via the Ubuntu Software application.

This is actually the Snap version of the CLion. It can be used on any Linux distribution that has Snap support.

Open your terminal (Ctrl+Alt+T) and type the following command to install the CLion IDE package.

$ sudo snap install clion --classic

The --classic option is required because the CLion snap requires full access to the system, like a traditionally packaged application.

That’s It. Now you can open the CLion application with the help of Activities search bar.

Method 2: Installing CLion IDE from Source

Compiling CLion IDE from the source allows you to install the latest CLion version. Follow the following steps to install CLion using the source code method.

Step #1

Open a terminal (CTRL+ALT+T) and execute the below commands to update packages.

$ sudo apt update && sudo apt upgrade

Step #2

Download the latest CLion source code package from the official website. You can do so using wget Command.

$ sudo wget https://download-cdn.jetbrains.com/cpp/CLion-2021.2.3.tar.gz

Or visit official website and download from there.

Step #3

Once the download is complete extract the .tar.gz file with the help of tar command.

Extract the tarball to a directory that supports file execution.

For example, to extract it to the recommended /opt directory, run the following command:

$ sudo tar -xzf CLion-2021.2.3.tar.gz -C /opt

Note: Do not extract the tarball over an existing installation to avoid conflicts. Always extract it to a clean directory.

Step #4

Execute the clion.sh from bin/ subdirectory to run CLion.

sh /opt/clion-*/bin/clion.sh

As soon as you run the script the CLion application will start.

At this step, you have successfully installed CLion IDE application on Ubuntu 20.04 system.

To create a desktop entry of the application: From the main menu of IDE, click Tools -> Create Desktop Entry.

Starting CLion

You can launch the CLion IDE application with the help of the Launcher icon created on the desktop.

OR run the clion.sh shell script in the installation directory under bin/.

When you run CLion for the first time, some steps are required to complete the installation, customize your instance, and start working with the IDE.

1. Select the user interface theme:

Select whether you want to use the default Darcula or Light theme.

Image Credit: jetbrains.com

2. Download and install additional plugins

If necessary, click Plugins in the left-hand pane and download and install additional plugins from the CLion plugins repository.

Image Credit: jetbrains.com

3. Configure toolchains

Next, you will be prompted to configure the toolchains. A toolchain is a set of the necessary tools required for building and running your application.

If there are toolchains already installed on your machine, CLion will automatically detect them.

You will always be able to configure the toolchains later in the Settings / Preferences | Build, Execution, Deployment | Toolchain dialog.

Image Credit: jetbrains.com

Start a project in CLion

Click Start using CLion, and you will see the Welcome screen. From there, you can do the following:

  • Create a new project
  • Open an existing project or file
  • Check out an existing project from a version control system

It is also possible to drag an existing project directory or a separate file to the Welcome screen and open it in CLion.

Image Credit: jetbrains.com

How to Uninstall CLion from Ubuntu 20.04

For some reason, If you want to uninstall CLion IDE application, refer following steps.

Step #1

Delete the installation directory.

Step #2

Remove following directories.

Syntax:
~/.config/JetBrains/<product><version>
~/.cache/JetBrains/<product><version>
~/.local/share/JetBrains/<product><version>
Example:
~/.config/JetBrains/CLion2021.2
~/.cache/JetBrains/CLion2021.2
~/.local/share/JetBrains/CLion2021.2

Conclusion

I hope that now you have a good understanding of How to Install Jetbrains CLion IDE on Ubuntu 20.04 LTS Focal Fossa.

If anyone does have any questions about what we covered in this guide then feel free to ask in the comment section below and I will do my best to answer those.

Source:

If you like our content, please consider buying us a coffee.

Buy Me A Coffee

We are thankful for your never ending support.

Leave a Comment