• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » List All Installed Packages on SSH (Ubuntu/deb GNU/Linux)

By Abhishek Ghosh May 22, 2015 7:14 am Updated on May 22, 2015

List All Installed Packages on SSH (Ubuntu/deb GNU/Linux)

Advertisement

Here is how to list all installed packages on SSH on deb GNU/Linux including Debian and Ubuntu Servers over SSH. New users frequently need it as they forget what or which tutorial or guide they followed. It is not uncommon to read our one guide for one part, then searching for another thing on Google and following another person’s guide. It can happen that, one package was installed, but that is not needed anymore.

 

List All Installed Packages on SSH (Ubuntu/deb GNU/Linux)

 

Copy paste this command on any text editor first, then copy to SSH and hit the return key :

Vim
1
( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:'

copy-pasting will evoke the webpage’s URL to get copied to protect contact-theft, that is why; copy on text editor first. We kept another way to to execute the command, here is a gist file of the command as bash script. You will only run these commands :

Advertisement

---

Vim
1
2
3
wget https://gist.github.com/AbhishekGhosh/790c9593048adee4735b/raw/5e2a82abc518a1d552a2d8a7af19bec9bdf99d94/packages.sh
chmod +x packages.sh
sh packages.sh

Against the command, you’ll get this list :

List All Installed Packages on SSH (Ubuntu:deb GNU:Linux)

This has security advantages too – it list the commands you typed to install or update the system. In case, you want the date of the works too, this modified command will work fine :

Vim
1
2
( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; \
cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep -B1 '^Commandline:'

You’ll get list like this :

Vim
1
2
3
4
5
Commandline: apt-get autoremove
Start-Date: 2015-05-22  01:34:32
Commandline: apt-get purge --auto-remove memcached php5-memcache
Start-Date: 2015-05-22  01:39:47
Commandline: apt-get purge --auto-remove monit rmon

We are getting the data from the log files, not apt. It is risk free for a running server. We have a separate gist for it on Github.

 

How I Will Handle the List of All Installed Packages on SSH

 

Suppose, you want to see all the works with xcache, then it is better to use the script :

Vim
1
2
wget https://gist.githubusercontent.com/AbhishekGhosh/45a209e6cb44dd8c9c9d/raw/9ba95b404eebd7d1721c4eb6439cc3767c84f145/packages-date.sh && chmod +x packages-date.sh
sh packages-date.sh | grep xcache

Now, you can replace whatever you are searching for with xcache after grep command to find it. This are the official commands :

Vim
1
2
dpkg --get-selections | grep -v deinstall
aptitude search '~i!~M'

the above are not exactly what people want over SSH. We want our manual work, not the dependencies got installed o system installed. We have not discovered the commands and we do not need to know who discovered the commands. They serve the purpose, that is enough.

Tagged With GNU linux list packages installed , list installed packages GNU/linux , ubuntu list all installed packages , ubuntu list packages installed
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to List All Installed Packages on SSH (Ubuntu/deb GNU/Linux)

  • Change Github’s Default Gist Style With jQuery Plugins

    Yes, There Are jQuery Plugins to Change Github’s Default Gist Style With jQuery Plugins! They can do lot of works than simple changing look.

  • Command Prompt Commands : Alphabetical list of all commands in Windows 7

    Command Prompt Commands in Windows 7 provides the user access to 180+ command line commands. Here is a list of 200 Command Prompt Commands in Windows 7.

  • Join/Merge Multiple Log Files For Big Data Analysis

    Here Are The Ways To Join/Merge Multiple Log Files For Big Data Analysis, Store Them To OpenStack Based Cloud Storage And Delete Old Files.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy