Linux list available package

How to list installed package and its details on ubuntu?

I am new to ubuntu and trying to find out the way to list all installed packages and its details like version, release, install time, category on Ubuntu. Found that following commands will help me get some of this information: 1) dpkg -l 2) dpkg-query -W -f=’$\t$\t$\n’ Unlike Redhat the install time and category information is missing in this. Can anyone know of a way to retrieve these details? Thanks in advance.

7 Answers 7

If you want to get the description of some specific packages say firefox :

sudo dpkg -l | grep firefox 
$ sudo dpkg -l | more Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-===========================================-=======================================-============================================================== ================ ii accountsservice 0.6.15-2ubuntu9.4 query and manipulate user account information ii acl 2.2.51-5ubuntu1 Access control list utilities ii acpi-support 0.140 scripts for handling many ACPI events ii acpid 1:2.0.10-1ubuntu3 Advanced Configuration and Power Interface event daemon ii activity-log-manager-common 0.9.4-0ubuntu3.2 blacklist configuration for Zeitgeist (assets) ii activity-log-manager-control-center 0.9.4-0ubuntu3.2 blacklist configuration for Zeitgeist (control center integrat ion) ii adduser 3.113ubuntu2 add and remove users and groups ii adium-theme-ubuntu 0.3.2-0ubuntu1 Adium message style for Ubuntu ii aisleriot 1:3.2.3.2-0ubuntu1 Solitaire card games ii akonadi-backend-mysql 1.7.2-0ubuntu1 MySQL storage backend for Akonadi ii akonadi-server 1.7.2-0ubuntu1 Akonadi PIM storage service ii alacarte 0.13.2-2ubuntu4 easy GNOME menu editing tool ii alsa-base 1.0.25+dfsg-0ubuntu1 ALSA driver configuration files ii alsa-utils 1.0.25-1ubuntu5 Utilities for configuring and using ALSA ii anacron 2.3-14ubuntu1 cron-like program that doesn't go by time ii apg 2.2.3.dfsg.1-2 Automated Password Generator - Standalone version ii app-install-data 0.12.04.4 Ubuntu applications (data files) ii app-install-data-partner 12.12.04.1 Application Installer (data files for partner applications/rep ositories) ii apparmor 2.7.102-0ubuntu3.7 User-space parser utility for AppArmor ii appmenu-gtk 0.3.92-0ubuntu1.1 Export GTK menus over DBus ii appmenu-gtk3 0.3.92-0ubuntu1.1 Export GTK menus over DBus ii appmenu-qt 0.2.6-0ubuntu1 appmenu support for Qt ii apport 2.0.1-0ubuntu17.1 automatically generate crash reports for debugging ii apport-gtk 2.0.1-0ubuntu17.1 GTK+ frontend for the apport crash report system ii apport-symptoms 0.16.1 symptom scripts for apport ii apt 0.8.16~exp12ubuntu10.7 commandline package manager ii apt-transport-https 0.8.16~exp12ubuntu10.7 https download transport for APT ii apt-utils 0.8.16~exp12ubuntu10.7 package managment related utility programs --More-- 

To get the date and time of packages being installed

cat /var/log/dpkg.log | grep " install " 

To get for specific package:

$cat /var/log/dpkg.log | grep " install " | grep banshee 2013-12-12 12:51:48 install banshee 2.4.1-3ubuntu1~precise2 2013-12-12 12:51:51 install banshee-extensions-common 2.4.0-1ubuntu1 2013-12-12 12:51:51 install banshee-extension-radiostationfetcher 2.4.0- 1ubuntu1 2013-12-12 12:51:51 install banshee-extension-soundmenu 2.4.1-3ubuntu1~precise2 

To get the section

$apt-cache show firefox | grep Section Section: web 

Источник

Читайте также:  Linux to many open file

How to Check if a Package is Available In Yum

Yellowdog Updater Modified or Yum for short is a package management tool for RPM packages. It is popular in the REHL family of Linux distributions, including CentOS and Fedora. Thus, you can think of yum as a bootstrap for RPM package manager.

Like popular package managers, Yum works via repositories that contain collections of tools in rpm format.

For this quick one, we will discuss the basics of yum and show available packages on a system using yum as a package manager.

Yum List Available Packages

To show available packages, we can use the yum list command as shown:

This command will display the name of all the available packages, the latest version, and the repositories to which they belong

Yum Check Installed Packages

Yum is incredibly easy to use; like most package managers, it allows you to pass intuitive options. For example, to show the list of installed packages, we can use the command:

Similar to show available packages, the command above will show the name of the packages installed, the version, and the source repository of the packages

You can pass the output from the command above to tools such as grep, less, etc.

Yum Search Specific Package

An example use case of the yum list command is checking if you have a specific package installed. For example, let us see if awk is installed.

The above command passes the output of the yum list to grep, which then searches for the specific string, in this case, ‘awk.’ Take a look at the example output below:

As you can see, we have awk installed (as part of gawk) and the python-Hawkey package.

Show Available Packages From A Specific Repo

You can also filter for the available package in a specific repository. We can start by listing all enabled repositories with the command:

This will list all the available repositories in the system.

To search for packages available only in a specific repo. An example, in the epel repository, we use the command:

Example output is as shown:

Conclusion

In this quick tutorial, we covered yum and showed the available and installed packages in the system.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list

Источник

How to List Installed Packages on Ubuntu

Ubuntu and other Linux-based systems use client applications to manage software directly. Some software packages come preinstalled by default, while system administrators install other packages when necessary.

Depending on which package manager installed the software, there are various ways to list installed packages on Ubuntu.

Читайте также:  Windows software on linux server

This tutorial teaches you to list the installed packages on an Ubuntu system.

How to List Installed Packages on Ubuntu

  • A Debian-based distribution such as Ubuntu.
  • A command line/terminal window (CTRL+ALT+T).
  • The apt, dpkg, or snap package manager.

List Ubuntu Packages Using apt

By default, newer Ubuntu versions (14.04 or newer) come with the apt package manager. The package manager helps conduct operations relating to software packages.

List All Installed and Available Packages

Use the following command to list all installed and available packages on Ubuntu:

apt list terminal output

The output shows a long list of packages with the version information and the package architecture. Shorten the list by piping the less command:

Navigate through the list by pressing the up or down arrow keys or space to skip to the next page. Press q to exit the viewer.

List Only Installed Packages

To list only installed packages, run:

apt list installed terminal output

The —installed tag ensures only installed packages show on the list. Each installed package has one of the following tags:

  • [installed] indicates the package installed manually from the repository list.
  • [installed, automatic] means the package installed automatically as a dependency for another installation.
  • [installed, local] indicates the package is not from the official repository list.

List Specific Packages

There are three different ways to list a specific package:

1. Add the package name to the apt list command to fetch a specific package from the list:

apt list installed package terminal output

Omit the —installed tag to fetch a package, regardless of installation.

2. Combine apt list with the grep command to match a package by name:

apt list --installed | grep -i

apt list installed grep package terminal output

The -i tag ignores letter casing, providing a broader search.

3. Another way to get package information is to use the apt show command:

apt show installed package terminal output

The command shows the package details, including installation information.

List Upgradable Packages

To list packages with available upgrades, run the following command:

apt list upgradable terminal output

The —upgradable tag filters packages and lists only the ones ready for an upgrade.

Note: If you’ve upgraded recently, the list is empty.

Count the Number of Installed Packages

Use the apt list command with the Linux wc command to count the number of lines:

apt -qq list --installed | wc -l

apt list count number of packages

The -qq tag quiets the output. Use the marker to ensure no additional lines print to the console and enter the count number.

List Ubuntu Packages Using dpkg

The dpkg package manager is included in earlier Ubuntu versions when apt is unavailable.

To list installed Ubuntu packages using the dpkg command, run:

dpkg --get-selections | grep -w "install"

dpkg installed packages list terminal output

Alternatively, use the dpkg-query tool:

dpkg-query installed packages list terminal output

In both cases, the output shows a long list of installed packages.

Create a List of all Installed Packages

To save the installed package names into a text file, use the following command:

dpkg --get-selections | grep -w "install" | cut -f1 > packages_list.txt

installed packages list text file

The cut command filters the output to only get the first column with the package names and saves the contents to a text file.

Count the Number of Installed Packages

Use the wc command to count the number of lines from the list of installed packages:

dpkg --get-selections | grep -w "install" | wc -l

dpkg installed packages count

The -l tag counts the number of lines from the dpkg —get-selections output.

Читайте также:  What is ldap authentication in linux

List Installed Packages Sorted by Date and Time

The dpkg logs store the date and time for package installations. To fetch all the information from log files, use the following command:

installed packages timestamp

The output shows the exact timestamp for installed packages. The logs are archived and deleted after a specific time, so the list is not comprehensive.

List Installed Snap Packages

Snap is an alternative package manager system. The previous commands do not show packages installed through Snap.

snap list terminal output

Note: Learn about the differences between the Snap packaging system and the apt package manager in Snap vs. Apt.

By following this guide, you should have learned how to list installed packages on Ubuntu and other Debian-based systems. If there is a problem with the installed packages, read our article on fixing broken packages in Ubuntu.

Milica Dancuk is a technical writer at phoenixNAP who is passionate about programming. Her background in Electrical Engineering and Computing combined with her teaching experience give her the ability to easily explain complex technical concepts through her content.

In Linux, special tools were developed for managing applications. Application software for Linux typically.

Источник

How to view all installed packages in terminal (Ubuntu)

dpkg-query actions See dpkg-query(1) for more information about the following actions.

 -l, --list package-name-pattern. List packages matching given pattern. -s, --status package-name. Report status of specified package. -L, --listfiles package-name. List files installed to your system from package-name. -S, --search filename-search-pattern. Search for a filename from installed packages. -p, --print-avail package-name. Display details about package-name, as found in /var/lib/dpkg/available. Users of APT-based frontends should use apt-cache show package-name instead. 

To list packages installed only by you:

gunzip -c /var/log/apt/history.log.*.gz | grep 'apt-get install' | cut -f4- -d" " | tr ' ' $'\n' | sort -u 

Solution: In order to view all installed packages in linux Ubuntu, run on terminal apt —installed list ,

Use apt flags and would be able to see available upgrades to some packages ( —upgradeable ) / current installed packages ( —installed ) / all available versions ( —all-versions ).

From Documentation:

DESCRIPTION apt provides a high-level commandline interface for the package management system. It is intended as an end user interface and enables some options better suited for interactive usage by default compared to more specialized APT tools like apt-get(8) and apt-cache(8). Much like apt itself, its manpage is intended as an end user interface and as such only mentions the most used commands and options partly to not duplicate information in multiple places and partly to avoid overwhelming readers with a cornucopia of options and details. 

the list flag offers 3 options:

list (work-in-progress) list is somewhat similar to dpkg-query --list in that it can display a list of packages satisfying certain criteria. It supports glob(7) patterns for matching package names as well as options to list installed (--installed), upgradeable (--upgradeable) or all available (--all-versions) versions. 

Источник

Оцените статью
Adblock
detector