This article provides step-by-step instructions on installing Gmsh 4.8.x binary package on a personal computer running on Ubuntu 21.04.

The instructions given are for a Ubuntu 21.04 system, but it should also work for Ubuntu 20.04 and other Ubuntu-compatible distributions with Pop!_OS inclusive.

Tested environment

An x64-based laptop running on Ubuntu 21.04

  • Linux kernel version: 5.11.0-25-generic

An x64-based desktop running on Pop!_OS 21.04

  • Linux kernel version: 5.11.0-7620-generic

Preparation

1: Get the latest stable Gmsh binary package for Linux from http://gmsh.info/#Download.

Gmsh installation file used: gmsh-4.8.4-Linux64.tgz

Setup & Initial Configuration

Prepare a dedicated package folder for Gmsh under your HOME directory (e.g. '~/Gmsh/').

$ cd ~/Gmsh/ (1)
1 The prompt symbol $ indicates that you are typing at a terminal emulator (e.g. Ubuntu Terminal).

Unzip the compressed file to the package folder:

$ tar -xvzf ~/Downloads/gmsh-4.8.4-Linux64.tgz -C ~/Gmsh/

Check the directory structure — either using Files browser or using tree (To use the tree command, install it by sudo apt install tree).

$ tree ~/Gmsh/ -d -L 2
/home/hawk/Gmsh/
└── gmsh-4.8.4-Linux64
    ├── bin
    └── share

3 directories
$ tree ~/Gmsh/gmsh-4.8.4-Linux64 -d -L 2
/home/hawk/Gmsh/gmsh-4.8.4-Linux64
├── bin
└── share
    ├── doc
    └── man

4 directories

Create a symbolic link for the Gmsh executable in the '/usr/local/bin/' folder:

$ sudo ln -s ~/Gmsh/gmsh-4.8.4-Linux64/bin/gmsh /usr/local/bin/gmsh

Double-check the installation by the accessibility:

$ which gmsh
/usr/local/bin/gmsh

You can now launch Gmsh by entering from a terminal:

$ gmsh &
shot0101

Try to open a sample geometry from File  Open  gmsh-4.8.4-Linux64/share/doc/gmsh/demos/api/asl-tu-203.stp. The default mouse operations are:

  • Left button: rotates the viewport

  • Middle button: zooms in/out the view; the same effect using the mouse wheel

  • Right button: moves the view laterally (i.e. panning).

shot0102

To exit from Gmsh, select File  Quit or click the window close button (x).