Linux list installed packages version

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 

Источник

Читайте также:  How to install metasploit kali linux

How to use yum to list All versions of Package in Linux

The default behavior of yum is to install the most recent version of a package from the enabled repositories. However, there are situations where it may be necessary to install a particular version or revert to an earlier version of a package that is already installed.

In this post, we will show how to make yum list all available versions of a specified package and how to instruct it to install the particular one.

Show All Versions of Package with yum

Run the following command to show all versions of a package, available in enabled repositories:

# yum list glibc-locale-source —showduplicates

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:31:11 ago on Wed 20 Jul 2022 02:01:41 AM GMT.
Installed Packages
glibc-locale-source.x86_64 2.28-151.el8 @wd_rpm
Available Packages
glibc-locale-source.x86_64 2.28-151.el8 wd_rpm
glibc-locale-source.x86_64 2.28-164.el8_5.3 wd_rpm

From the output, we can see that there are 3 packages in total. One package is installed. Two packages are available to install from remote repository.

Installed Packages: This section lists the packages that are currently installed on the system. In this case, it shows that the glibc-locale-source package with version 2.28-151.el8 is installed (@wd_rpm indicates it was installed from wd_rpm package repository).

Available Packages: This section lists the available packages that can be installed from the configured repositories. Here, it shows that there are two available versions of glibc-locale-source: version 2.28-151.el8 and version 2.28-164.el8_5.3. The wd_rpm tag indicates that these versions are available from remote package repository.

Install Specific Version Of Package with yum in Linux

To install a specific version of a package, run: $ sudo yum install –

yum install glibc-locale-source-2.28-151.el8

If you’re looking how install a package on Linux, we strongly suggest reading this article.

Читайте также:  Linux настройка тонкого клиента

Force Yum To Downgrade Package

If we already have the latest version of a package installed, but we need to downgrade it to the particular version that is older, execute:

understanding RPM file name

RPM package files names consist of four elements (plus the .rpm suffix): name-version- release.architecture:

Here is one example. kernel-4.18.0-425.3.1.el8.x86_64

Name : kernel
Version : 4.18.0
Release : 425.3.1.el8
Architecture : x86_64
Size : 8.8 M

Only the package name is required for installing packages from repositories. If multiple versions exist, the package with the higher version number is installed. If multiple releases of a single version exist, the package with the higher release number is installed.

Install, uninstall & upgrade packages with yum

Here are the Yum commands for installing, removing and updating packages.

Command Functionality Example command
install Install a package from yum repository yum install nginx
remove Remove an installed package and its dependencies yum remove nginx
erase Similar to remove command yum erase nginx
update Update or or more packages on the system yum update or sudo yum update gcc
update-to Update or or more packages to a specific version yum update-to ngingx-2.7-1.1
upgrade update all packages to the latest version yum upgrade
reinstall Reinstall current version of a specific package yum reinstall httpd
autoremove Remove a package and all other unnecessary packages yum autoremove httpd
downgrade Downgrade a specific package to an earlier version yum downgrade nginx
swap Remove package and install another yum swap nginx httpd
localinstall Install a package from a local repository yum localinstall package.rpm
groupinstall Install packages from a specific group yum groupinstall “group name”

Base Package Commands in yum

These commands will help you explore installed packages or search for packages from repositories.

Command Functionality Example
list List package names from repositories sudo yum list all
info Show information about a specific package sudo yum info nginx
search Search for a package name and description sudo yum search apache
updateinfo Show information about available package updates sudo yum updateinfo baseos
check-update Show available package updates from enabled repositories sudo yum check-update
grouplist Show names and available package groups sudo yum grouplist
deplist Show dependencies for a specific package sudo yum deplist vsftpd
provides Locate the package that provides a specific file sudo yum provides “*/bin/zsh”
groupinfo Show description and contents of a package group sudo yum groupinfo “group name”
help Display yum help information or help on sub command sudo yum help or sudo yum help list
Читайте также:  Wifi tp link archer t3u linux

Managing Yum Repos

For adding and managing additional repositories.

Command Functionality Example
repolist List the available software repositories sudo yum repolist
repo-pkgs Use packages in a specific repository sudo yum repo-pkgs baseos list
repoinfo Show information about enabled repositories sudo yum repoinfo baseos
makecache Download repository data to cache sudo yum makecache

Troubleshooting Yum

When things go wrong with Yum, use these commands.

Command Functionality Example
clean Clean out all cached package data/clean all packages metadata sudo yum clean packages or sudo yum clean all
check Check local RPM db for problems sudo yum check
history View and use yum transactions sudo yum history list or sudo yum history undo or sudo yum history redo
fssnapshot Show LVM snapshots sudo yum fs filters

Helpful Options

Common options to be used with Yum commands:

Command Option Functionality Example
-y Assume yes if prompted sudo yum -y install nginx
–assumeno Assume no if prompted sudo yum –assumeno install nginx
-v Verbose sudo yum -v install
-q Quiet sudo yum -q install
–noplugins Do not load any YUM plugins sudo yum –noplugins install
–disableplugin= Deactivate a specific plugin sudo yum –disableplugin=ps
–enableplugin= Activate a specific plugin sudo yum –enableplugin=ps
–changelogs Show changelog info of a package sudo yum –changelogs install httpd
—filter=?? Filter output for specific vendors, groups, architectures, and others. sudo yum list available –filter=server
–enablerepo= Enable a deactivated repo sudo yum install nginx –enablerepo=??
–disablerepo= Disable an activated repo sudo yum install nginx –deactivaterepo=??
–downloadonly Download package and no install sudo yum install –downloadonly httpd

yum Extra Commands

Some additional commands that you may need to use once a while:

Commands Functionality
reposync Synchronize yum repo to local directory
show-installed Show installed packages
verifytree Check local repo for consistency
yumdb Change yum database
yumdownloader Download a package from repo to cwd
repouery Query remote repo and local db
repoclosure Get unmet dependency list
needs-restarting Show processes that have been updated and require restart

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

howtouselinux.com is dedicated to providing comprehensive information on using Linux.

We hope you find our site helpful and informative.

Источник

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