Bosse_B
Posts: 793
Joined: Thu Jan 30, 2014 9:53 am

How can I find if software is installed?

Wed Oct 15, 2014 10:57 pm

Not very Linux savvy....
I want to know if a specific software is installed in my Pi.
In this case it is pptp VPN server, which is installed using command:
sudo apt-get install pptpd

I want to avoid overwriting any already installed version so I just want to know if it is there already.
How do I accomplish that (using PuTTY to work with the Pi) ??
Bo Berglund
Sweden

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: How can I find if software is installed?

Wed Oct 15, 2014 11:00 pm

Just try installing it, it will either tell you its already the latest version or prompt you before it actually does anything.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

DirkS
Posts: 9936
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How can I find if software is installed?

Wed Oct 15, 2014 11:29 pm

apt-cache show pptpd
apt-cache policy pptpd
and probably more...

kursus
Posts: 25
Joined: Thu Oct 31, 2013 2:36 pm

Re: How can I find if software is installed?

Thu Oct 16, 2014 12:04 am

As DirkS said, also remember that apt-get install :

- asks for a confirmation before doing anything
- installs only if the version is newer
- does not delete your preferences on updates

plugwash
Forum Moderator
Forum Moderator
Posts: 3453
Joined: Wed Dec 28, 2011 11:45 pm

Re: How can I find if software is installed?

Thu Oct 16, 2014 12:23 am

kursus wrote: - asks for a confirmation before doing anything
This is incorrect.afaict It only asks for confirmation if it needs to do something beyond what you asked it to do.

Bosse_B
Posts: 793
Joined: Thu Jan 30, 2014 9:53 am

Re: How can I find if software is installed?

Thu Oct 16, 2014 12:29 am

Thanks guys,
I tried the apt-get install pptpd and it told me that I already had the latest version!
So I am good to go.
Bo Berglund
Sweden

klricks
Posts: 6586
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: How can I find if software is installed?

Thu Oct 16, 2014 2:16 am

Bosse_B wrote:Thanks guys,
I tried the apt-get install pptpd and it told me that I already had the latest version!
So I am good to go.
Remember the latest version available for the RPi may or may not be the latest available for the same program in other platforms.

You can use a package manager to view installed programs as well as search for and install new programs.
Aptitude package manager (Text based menu) is installed by default in Raspbian.
Synaptic package manager (GUI) can be installed:
sudo apt-get install synaptic
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

hal8000
Posts: 187
Joined: Fri Oct 04, 2013 5:22 pm

Re: How can I find if software is installed?

Thu Oct 16, 2014 10:08 am

Synaptic is the easiest way to see what is installed, but if you're accessing the RPi remotely, then from the shell
(provided you're using Rasbian or other image based on Debian) then just use:

dpkg -l | more

(Above shows all packes installed).
If you wanted to check for a particular package

dpkg-query -l 'htop'

Would search for package htop

gdt
Posts: 85
Joined: Thu Jul 19, 2012 10:19 am

Re: How can I find if software is installed?

Sat Oct 18, 2014 10:17 am

For future reference, you can search the list of all available packages with

Code: Select all

[email protected] ~ $ apt-cache search pptp
bcrelay - Broadcast relay daemon
gosa-plugin-pptp - pptp plugin for GOsa²
gosa-plugin-pptp-schema - LDAP schema for GOsa² pptp plugin
kvpnc - vpn clients frontend for KDE4
network-manager-pptp - network management framework (PPTP plugin core)
network-manager-pptp-gnome - network management framework (PPTP plugin GNOME GUI)
pptp-linux - Point-to-Point Tunneling Protocol (PPTP) Client
pptpd - PoPToP Point to Point Tunneling Server
and then see if the package name you are interested in is actually installed with

Code: Select all

[email protected] ~ $ dpkg-query --status pptpd
dpkg-query: package 'pptpd' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
In this case "pptpd" is not installed, and has never been installed. If the package is installed the output looks like this (in this case, for the package 'bash'):

Code: Select all

[email protected] ~ $ dpkg-query --status bash
Package: bash
Essential: yes
Status: install ok installed
Priority: required
Section: shells
Installed-Size: 3778
Maintainer: Matthias Klose <[email protected]>
Architecture: armhf
Multi-Arch: foreign
Version: 4.2+dfsg-0.1+deb7u3
Replaces: bash-completion (<< 20060301-0), bash-doc (<= 2.05-1)
Depends: base-files (>= 2.1.12), debianutils (>= 2.15)
Pre-Depends: dash (>= 0.5.5.1-2.2), libc6 (>= 2.13-28), libgcc1 (>= 1:4.4.0), libtinfo5
Recommends: bash-completion (>= 20060301-0)
Suggests: bash-doc
Conflicts: bash-completion (<< 20060301-0)
Conffiles:
 /etc/skel/.bash_logout 22bfb8c1dd94b5f3813a2b25da67463f
 /etc/skel/.bashrc d5f897a5ec2b5f55b412004e7715977f
 /etc/skel/.profile ecb6d3479ac3823f1da7f314d871989b
 /etc/bash.bashrc 6334b485d48f479d8de056806b274cd3
Description: GNU Bourne Again SHell
 Bash is an sh-compatible command language interpreter that executes
 commands read from the standard input or from a file.  Bash also
 incorporates useful features from the Korn and C shells (ksh and csh).
 .
 Bash is ultimately intended to be a conformant implementation of the
 IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
 .
 The Programmable Completion Code, by Ian Macdonald, is now found in
 the bash-completion package.
Homepage: http://tiswww.case.edu/php/chet/bash/bashtop.html

Return to “General discussion”