How To Install petsc-dev on Ubuntu 18.04

In this tutorial we learn how to install petsc-dev on Ubuntu 18.04. petsc-dev is Virtual package depending on latest PETSc development package

Introduction

In this tutorial we learn how to install petsc-dev on Ubuntu 18.04.

What is petsc-dev

petsc-dev is:

PETSc is the “Portable Extensible Toolkit for Scientific Computation”, a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication. Several sample scientific applications, as well as various papers and talks, demonstrate the features of the PETSc libraries.

This metapackage will always depend on the most recent version of petscX-dev (X=version), so if you install it then you will get upgrades automatically.

There are three methods to install petsc-dev on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install petsc-dev Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install petsc-dev using apt-get by running the following command:

sudo apt-get -y install petsc-dev

Install petsc-dev Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install petsc-dev using apt by running the following command:

sudo apt -y install petsc-dev

Install petsc-dev Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install petsc-dev using aptitude by running the following command:

sudo aptitude -y install petsc-dev

How To Uninstall petsc-dev on Ubuntu 18.04

To uninstall only the petsc-dev package we can use the following command:

sudo apt-get remove petsc-dev

Uninstall petsc-dev And Its Dependencies

To uninstall petsc-dev and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove petsc-dev

Remove petsc-dev Configurations and Data

To remove petsc-dev configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge petsc-dev

Remove petsc-dev configuration, data, and all of its dependencies

We can use the following command to remove petsc-dev configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge petsc-dev

References

Summary

In this tutorial we learn how to install petsc-dev package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.