LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-12-2009, 12:37 AM   #1
matrix13
Member
 
Registered: Nov 2006
Location: Kerala, India
Distribution: Arch Linux
Posts: 134

Rep: Reputation: 25
Question knowing whether a package is installed or not using apt tool


Can I know the status of a package using apt-cache or apt-get or etc? I mean can I know whether a package is installed in the machine or not using apt.

I know that, when I try to install a package using:
Quote:
apt-get install pkg-name
it outputs that the package is already installed, if it is so.

But, I want to search for a package and know whether it is previously installed or not.

Do I have to use tools other that apt for this?

Thanks and regards
 
Old 02-12-2009, 03:53 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Quote:
Originally Posted by matrix13 View Post
Can I know the status of a package using apt-cache or apt-get or etc? I mean can I know whether a package is installed in the machine or not using apt.

I know that, when I try to install a package using:

it outputs that the package is already installed, if it is so.

But, I want to search for a package and know whether it is previously installed or not.

Do I have to use tools other that apt for this?

Thanks and regards
If you have aptitude installed this is quite easy:
Code:
aptitude search [package name]
(you don't have to be root to run aptitude search ...)
For example if I run aptitude search gnutls I get this:
Code:
p   gnutls-bin                      - the GNU TLS library - commandline utilitie
v   gnutls-dev                      -
p   gnutls-doc                      - the GNU TLS library - documentation and ex
p   guile-gnutls                    - the GNU TLS library - GNU Guile bindings
p   libapache2-mod-gnutls           - Apache2 module for SSL and TLS encryption
i A libcurl3-gnutls                 - Multi-protocol file transfer library (GnuT
v   libcurl3-gnutls-dev             -
p   libcurl4-gnutls-dev             - Development files and documentation for li
i A libgnutls-dev                   - the GNU TLS library - development files
i   libgnutls13                     - the GNU TLS library - runtime library
i   libgnutls26                     - the GNU TLS library - runtime library
p   libgnutls26-dbg                 - GNU TLS library - debugger symbols
c   libgnutlsxx13                   - the GNU TLS library - C++ runtime library
p   libneon26-gnutls                - An HTTP and WebDAV client library (GnuTLS
p   libneon26-gnutls-dbg            - Detached symbols for libneon26 (GnuTLS ena
p   libneon26-gnutls-dev            - Header and static library files for libneo
p   libneon27-gnutls                - An HTTP and WebDAV client library (GnuTLS
p   libneon27-gnutls-dbg            - Detached symbols for libneon27 (GnuTLS ena
p   libneon27-gnutls-dev            - Header and static library files for libneo
p   libxmlsec1-gnutls               - Gnutls engine for the XML security library
p   python-gnutls                   - Python wrapper for the GNUTLS library
v   python2.4-gnutls                -
v   python2.5-gnutls
The packages whose lines begin with "i" are installed.
Cheers,
jdk
 
Old 02-12-2009, 03:57 AM   #3
matrix13
Member
 
Registered: Nov 2006
Location: Kerala, India
Distribution: Arch Linux
Posts: 134

Original Poster
Rep: Reputation: 25
Thank you
 
  


Reply

Tags
apt



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Knowing which all packages request a particular package as dependency kushalkoolwal Debian 6 01-05-2009 08:38 PM
apt-get how to cancel partially installed kernel package? zeigerpuppy Debian 1 01-15-2006 09:40 AM
Apt-get: How to remove software without knowing package name? sureshot324 Linux - Software 4 10-27-2005 01:14 PM
Package Management tool doesn't see installed packages (FC1) pekkerhed Fedora 5 06-04-2004 03:56 PM
Does apt-get install <package> upgrade the package if it is already installed? davidas Debian 4 04-05-2004 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration