Install CLion on Ubuntu 24.04

Install CLion on Ubuntu 24.04

CLion is an integrated development environment (IDE) tailored for C and C++ development, built by JetBrains. It provides advanced features such as code navigation, intelligent refactoring, integrated debugging, and CMake support. This tutorial demonstrates how to install CLion on Ubuntu 24.04.

Install CLion

Start by fetching the most up-to-date release number of CLion from JetBrains using their API:

CLION_VERSION=$(curl -s "https://data.services.jetbrains.com/products/releases?code=CL&latest=true&type=release" | grep -Po '"version":"\K[0-9.]+')

Download the corresponding archive for the retrieved version:

wget -O clion.tar.gz https://download.jetbrains.com/cpp/CLion-$CLION_VERSION.tar.gz

Next, create a directory where CLion will be installed, and unpack the downloaded archive into it:

sudo mkdir -p /opt/clion
sudo tar xf clion.tar.gz --strip-components=1 -C /opt/clion

After the extraction is done, you can delete the archive file to free up space:

rm -rf clion.tar.gz

Testing CLion

To start the CLion and verify the setup was successful, execute:

/opt/clion/bin/clion

Once CLion is running, you can choose to create a desktop shortcut from within the IDE to simplify future access.

Uninstall CLion

If you ever need to uninstall CLion, simply delete its installation directory:

sudo rm -rf /opt/clion

If you created a desktop entry, you can remove that too:

sudo rm -rf /usr/share/applications/jetbrains-clion.desktop

Optionally, clear user-specific configuration, cache, and other related data:

rm -rf ~/.{cache,config,local/share}/JetBrains/CLion*

Leave a Comment

Cancel reply

Your email address will not be published.