How To Install ncbi-entrez-direct on Ubuntu 20.04

In this tutorial we learn how to install ncbi-entrez-direct on Ubuntu 20.04. ncbi-entrez-direct is NCBI Entrez utilities on the command line

Introduction

In this tutorial we learn how to install ncbi-entrez-direct on Ubuntu 20.04.

What is ncbi-entrez-direct

ncbi-entrez-direct is:

Entrez Direct (EDirect) is an advanced method for accessing NCBI’s set of interconnected databases (publication, sequence, structure, gene, variation, expression, etc.) from a terminal window or script. Functions take search terms from command-line arguments. Individual operations are combined to build multi-step queries. Record retrieval and formatting normally complete the process.

EDirect also provides an argument-driven function that simplifies the extraction of data from document summaries or other results that are returned in structured XML format. This can eliminate the need for writing custom software to answer ad hoc questions. Queries can move seamlessly between EDirect commands and UNIX utilities or scripts to perform actions that cannot be accomplished entirely within Entrez.

There are three methods to install ncbi-entrez-direct on Ubuntu 20.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 ncbi-entrez-direct Using apt-get

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

sudo apt-get update

After updating apt database, We can install ncbi-entrez-direct using apt-get by running the following command:

sudo apt-get -y install ncbi-entrez-direct

Install ncbi-entrez-direct Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install ncbi-entrez-direct using apt by running the following command:

sudo apt -y install ncbi-entrez-direct

Install ncbi-entrez-direct 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 ncbi-entrez-direct using aptitude by running the following command:

sudo aptitude -y install ncbi-entrez-direct

How To Uninstall ncbi-entrez-direct on Ubuntu 20.04

To uninstall only the ncbi-entrez-direct package we can use the following command:

sudo apt-get remove ncbi-entrez-direct

Uninstall ncbi-entrez-direct And Its Dependencies

To uninstall ncbi-entrez-direct and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove ncbi-entrez-direct

Remove ncbi-entrez-direct Configurations and Data

To remove ncbi-entrez-direct configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge ncbi-entrez-direct

Remove ncbi-entrez-direct configuration, data, and all of its dependencies

We can use the following command to remove ncbi-entrez-direct configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge ncbi-entrez-direct

References

Summary

In this tutorial we learn how to install ncbi-entrez-direct package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.