Linux package list ubuntu

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 убрать атрибут исполняемый

How To List All Packages In A Repository On Ubuntu, Debian Or Linux Mint [APT]

This article explains how to list all the packages available in an Ubuntu, Linux Mint or Debian repository (installed and available for install), be it an official repository or a third-party source like a PPA, and so on.

Below you’ll find 2 ways of listing packages from a repository: using a GUI or from the command line.

List all packages in a Debian, Ubuntu or Linux Mint repository using a GUI

If you want to list all the packages in a repository on your desktop, you can use Synaptic Package Manager.

Synaptic is a graphical package management application for APT (APT being the main command line package manager for Debian and its derivatives).

If you don’t have Synaptic installed, you can install it on Debian, Ubuntu, and any Debian or Ubuntu based Linux distribution, including elementary OS, Linux Mint and so on, by using this command:

sudo apt install synaptic

To list all the packages in a particular software repository using Synaptic, launch the application and click on Origin in the bottom left-hand side of its window. Next, select the repository for which you want to list all available packages (both installed and available for installation) from the list that’s displayed in the left-hand side of Synaptic Package Manager.

For example, here’s Synaptic showing all the packages available in the Google repository, listing Google Chrome stable, beta and unstable, as well as Google Earth Pro and EC:

Synaptic list all packages in a repository on Ubuntu or Debian

As you can see, all the software sources are listed here, including the official repositories.

Launchpad PPA repositories are supported as well. Their name begins with LP-PPA, followed by the actual PPA name. Synaptic lists 2 entries for each PPA — make sure you select the PPA entry ending with /ubuntu-codename , for example /bionic , /cosmic , etc. The entry ending in /now doesn’t list all the available packages in the PPA.

This is a screenshot showing all the packages available in the Ubuntu Graphics Drivers PPA (for Ubuntu 18.10 Cosmic Cuttlefish, since that’s what I’m using), including showing which are installed on my system:

Читайте также:  Linux show hidden folders

Synaptic list all packages in a repository

I’m not sure why, but some packages are listed multiple times for PPA sources (and only for PPA repositories). That only a display thing, and it doesn’t break any functionality.

List all packages in a repository in Ubuntu, Debian or Linux Mint from the command line

Listing all packages in a repository from the command line in Ubuntu, Debian or Linux Mint is a bit tricky, but still quite easy to do.

There are multiple ways of doing this from the command, but I’ll only list one. The command to list all packages available in repository-name is the one that follows:

grep ^Package /var/lib/apt/lists/repository-name*_Packages | awk '' | sort -u

I’ll explain later on how to find out the repository name from /var/list/apt/lists and how to use it. Before that I’ll explain what this command does:

  • grep ^Package . searches for lines beginning with ^Package in the /var/lib/apt/lists/*_Packages file
  • awk » prints the second column for each line (so it filters out everything but the package name)
  • sort -u sorts the lines and outputs only unique lines (removes duplicates)
ls /var/lib/apt/lists/*_Packages

Since the results may be very long, you can run the command output through more for easier reading:

ls /var/lib/apt/lists/*_Packages | more

If you know part of the repository name (I’m using KEYWORD in the command below as the name), you can filter the ls results using grep , like this:

ls /var/lib/apt/lists/*_Packages | grep KEYWORD

For example, let’s say you want to list all the packages in the official Tor repository, and you know the repository name must contain tor . In this case, you’d use this command to find out the _Packages filename from /var/lib/apt/lists/

ls /var/lib/apt/lists/*_Packages | grep tor

For short queries, some unrelated repositories might be displayed, but it’s still easier to see what you’re looking for using grep than listing all the repositories _Packages files.

Now that you know the _Packages filename, you can list all the packages available in that repository by issuing this command:

grep ^Package /var/lib/apt/lists/some-repository-amd64_Packages | awk '' | sort -u

Use the file containing the architecture for which you want to list all available packages in that repository. The example above is for 64bit ( amd64 ), but you could use i386 for 32bit, etc.

You don’t need the complete repository _Packages filename. Back to my Tor repository example, the _Packages filename for Tor is deb.torproject.org_torproject.org_dists_cosmic_main_binary-amd64_Packages . In this case, you could use deb.torproject followed by *_Packages to simplify things, like this:

grep ^Package /var/lib/apt/lists/deb.torproject*_Packages | awk '' | sort -u

Which outputs the following:

deb.torproject.org-keyring tor tor-geoipdb

Another example. Let’s say you want to see all packages available in the Linux Uprising Oracle Java 11 PPA ( ppa:linuxuprising/java ). You can list them by using:

grep ^Package /var/lib/apt/lists/ppa.launchpad.net_linuxuprising_java*_Packages | awk '' | sort -u
oracle-java11-installer oracle-java11-set-default

To use this with other PPA repositories, replace linuxuprising with the first part of the PPA name, and java with the second part of the PPA name, and the command will list all the packages from that PPA (both installed and not installed).

Читайте также:  Linux command exit value

You can also list all the packages available in all the PPA repositories you have added on your system, by using:

grep ^Package /var/lib/apt/lists/ppa.launchpad.net*_Packages | awk '' | sort -u

For easy access, you could bookmark this command using Marker commands bookmark manager (while used primarily for searching, HSTR can bookmark commands as well).

Источник

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