Cyberithub

How to Install zlib package on Ubuntu 20.04 LTS (Focal Fossa)

Advertisements

In this article, I will take you through the steps to install zlib package on Ubuntu 20.04 LTS (Focal Fossa). zlib is a free and open source library used for data compression. This library was written by Jean-loup Gailly and Mark Adler as an abstraction of the DEFLATE compression algorithm used in their gzip file compression program. Mostly you will find this package already available in your System but in case it is not available then you can follow below steps to install this package. More on wikipedia.

How to Install zlib package on Ubuntu 20.04 LTS (Focal Fossa)

How to Install zlib package on Ubuntu 20.04 LTS (Focal Fossa)

Also Read: How to Install dnsutils package on Ubuntu 20.04 LTS (Focal Fossa)

Advertisements

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have a sudo or root access to run privileged commands.

Advertisements

c) You should have apt utility available in your Server.

 

Step 2: Update Your Server

To sync your System with all the latest available updates from Ubuntu repo, you can use apt update command as shown below. In the case any of the packages needs to be upgraded, you can run apt upgrade command as well.

Advertisements
root@cyberithub:~# apt update
Hit:2 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:6 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:7 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Get:8 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:9 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu focal InRelease
Hit:10 https://repo.protonvpn.com/debian stable InRelease
Hit:11 http://download.opensuse.org/repositories/home:/selmf/xUbuntu_20.04 InRelease
Hit:1 https://downloads.apache.org/cassandra/debian 40x InRelease
Get:12 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,744 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [278 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [918 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [391 kB]
Get:16 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:17 http://in.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [8,008 B]
Get:18 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.8 kB]
Get:19 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [40.8 kB]
Get:20 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [66.4 kB]
Get:21 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Fetched 3,818 kB in 3s (1,224 kB/s)
....................................

 

Step 3: Install zlib package

In the next step, you can use apt install zlib1g command to install the zlib package as shown below.

root@cyberithub:~# apt install zlib1g
Reading package lists... Done
Building dependency tree
Reading state information... Done

If you need to install zlib1g-dev package then you can install that as well by using apt install zlib1g-dev command as shown below.

Advertisements
root@cyberithub:~# apt install zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done

 

Step 4: Verify Package Installation

After successful installation you can verify the package files by using dpkg -L zlib1g command as shown below.

root@cyberithub:~# dpkg -L zlib1g
/.
/lib
/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu/libz.so.1.2.11
/usr
/usr/share
/usr/share/doc
/usr/share/doc/zlib1g
/usr/share/doc/zlib1g/changelog.Debian.gz
/usr/share/doc/zlib1g/copyright
/lib/x86_64-linux-gnu/libz.so.1

Similarly you can also verify zlib1g-dev package files by using dpkg -L zlib1g-dev command as shown below.

root@cyberithub:~# dpkg -L zlib1g-dev
/.
/usr
/usr/include
/usr/include/zconf.h
/usr/include/zlib.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libz.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc
/usr/share
/usr/share/doc
/usr/share/doc/zlib1g-dev
/usr/share/doc/zlib1g-dev/FAQ.gz

Leave a Comment