25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

How to list installed software on CentOS 7 & Ubuntu 18

by | Jan 25, 2021

Wondering How to list installed software on CentOS 7 & Ubuntu 18? We can help you.

In this article, we will see the commands to list all software, list the number of packages installed, and search for a specific package.

Also, we will add installed software on a text file, and later install the software from the text file.

Here at Bobcares, we use these commands often as a part of our Server Management Services.

 

How to list installed software on CentOS 7 & Ubuntu 18

We will use a file to store a list of all currently installed software named “allsoftwares.txt”

Incase of reinstalling the base Linux system, we can copy or upload this file into the system so that we will get all the software that existed before formatting the system.

Here go through the commands used by our Support Techs to list installed software on CentOS7 and Ubuntu18.

Commands used for CentOS7

list installed software

 

Yum and rpm are commonly used on CentOS 7 servers.

1. Using RPM

To List all software:

[root@host ~]# rpm -qa

For listing the number of packages installed:

[root@host ~]# rpm -qa | wc -l

To search for a specific package:

[root@host ~]# rpm -q tmux

Adding installed software to a text file:

[root@host ~]# rpm -qa | tr '\n' ' ' > allsoftwares.txt

 

2. Using YUM

To list all software:

[root@host ~]# yum list installed

For listing the number of packages installed:

[root@host ~]# yum list installed | wc -l

To search for a specific package:

[root@host ~]# yum list installed | grep unzip

Adding installed software to a text file:

[root@host ~]# yum list installed | awk '{print $1}' | tr '\n' ' ' > allsoftwares.txt

Install software from the text file:

[root@host ~]# yum -y install $(cat allsoftwares.txt)

 

Commands used for Ubuntu18

 

list installed software

Apt and dpkg are commonly used on Ubuntu servers

1. Using APT

To list all software:

[root@host ~]# apt list --installed

For listing the number of packages installed:

[root@host ~]# apt list --installed | wc -l

To search for a specific package:

[root@host ~]# apt list --installed | grep PHP

Adding installed software to a text file:

[root@host ~]# apt list --installed > allsoftwares.txt

Or

[root@host ~]# apt list --installed | awk -F/ -v ORS=" " 'NR>1 {print $1}' > allsoftwares.txt

Installing software from the text file:

[root@host ~]# xargs -a allsoftwares.txt apt install

 

2. Using DPKG

To list all software:

[root@host ~]# dpkg -l | grep ^ii

For listing the number of packages installed:

[root@host ~]# dpkg -l | grep ^ii | wc -l

To search for a specific package:

[root@host ~]# dpkg -l | grep ^ii | grep -i PHP

Adding installed software to a text file:

[root@host ~]# dpkg-query -f '${binary:Package}\n' -W > allsoftwares.txt

or

[root@host ~]# dpkg --get-selections > allsoftwares.txt

Installing software from the text file:

[root@host ~]# apt-get install < allsoftwares.txt

[Need assistance? We are happy to help you!]

 

Conclusion

To conclude we saw the various commands our Support Engineers use to list all software, the number of packages available on the server along with the method to copy them and use them when we reinstall our operating system(OS).

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF