Sunday, September 4, 2022

Ubuntu/Azure: Upgrade an Ubuntu 20.04.4 LTS VM to the latest cmake

This post demonstrates how to install the latest version of cmake on an Azure Ubuntu 20.04.4 LTS virtual machine (VM).

In the post, Ubuntu: Upgrade to the latest cmake, the steps required to install the latest version of cmake on Ubuntu 20.04.4 LTS were presented. These aforementioned steps apply to environments like running Ubuntu under WSL where the native Ubuntu image was used to create the virtual machine or image. Multiple bash commands were required to install cmake and similarly, the uninstall required multiple bash commands.

Azures Ubuntu 20.04.4 LTS VMs contain additional packages to that of a stock Ubuntu image. These packages include Snap, a popular package manager. Using Snap the latest version of cmake can be installed as follows:

sudo snap install cmake --classic

The output from the above install steps is shown below where the version of cmake (3.24.1) is displayed during installation:

Be warned:

Using apt-get to install cmake will get Ubuntu's version of cmake which is not the latest version of cmake. This means that features like DOWNLOAD_NO_EXTRACT will not be available to cmake.

The steps to uninstall cmake using the snap command are as follows:

sudo snap remove cmake

Appendix A: Snap

For those new to snap (see Snap (software)):

No comments :

Post a Comment