How To Install libfl-dev on Ubuntu 18.04

In this tutorial we learn how to install libfl-dev on Ubuntu 18.04. libfl-dev is static library for flex (a fast lexical analyzer generator)

Introduction

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

What is libfl-dev

libfl-dev is:

Flex is a tool for generating scanners: programs which recognized lexical patterns in text. It reads the given input files for a description of a scanner to generate. The description is in the form of pairs of regular expressions and C code, called rules. Flex generates as output a C source file, lex.yy.c, which defines a routine yylex(). This file is compiled and linked with the -lfl library to produce an executable. When the executable is run, it analyzes its input for occurrences of the regular expressions. Whenever it finds one, it executes the corresponding C code.

This package contains the static library for flex.

There are three methods to install libfl-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 libfl-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 libfl-dev using apt-get by running the following command:

sudo apt-get -y install libfl-dev

Install libfl-dev Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libfl-dev

Install libfl-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 libfl-dev using aptitude by running the following command:

sudo aptitude -y install libfl-dev

How To Uninstall libfl-dev on Ubuntu 18.04

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

sudo apt-get remove libfl-dev

Uninstall libfl-dev And Its Dependencies

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

sudo apt-get -y autoremove libfl-dev

Remove libfl-dev Configurations and Data

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

sudo apt-get -y purge libfl-dev

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

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

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

References

Summary

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