Sample Header Ad - 728x90

How to find out if a specific package is installed on Debian?

15 votes
9 answers
32430 views
I'm working with a Raspberry Pi B+ and Raspbian 5/5/2015 and some guides that are a few years old. I've got an external NTFS HDD hooked up to the Pi. Due to the articles age(s), common practices have changed, and it turns out that certain packages and features and functions are now built-in and/or automatic. For example, I found out that Raspbian will handle the automounting of an NTFS drive/volume if you just install ntfs-3g. All instructions and guidance I could find (IRC, raspberry pi forum, and a Linux dude I know) all went extremely technical doing who-knows-what to my system to try to assist me, when in reality we were all tripping over automatic features that no one knew about or thought to check. I've since installed Raspbian fresh to a new SD card and so far just turned on SSH, updated apt-get, and installed ntfs-3g. This is the article I am using right now: http://www.howtogeek.com/139433/how-to-turn-a-raspberry-pi-into-a-low-power-network-storage-device/?PageSpeed=noscript My next step is to get Samba up and running. Yes, I know Linux people hate Windows, but I'm a Windows guy, so until I can know enough about Linux for a Linux system to be my fallback, Windows machines are my fallbacks. Eventually this Raspberry Pi will get a multi-TB drive, though for right now it's just a few GB; which is why it needs to be NTFS. I would like to check if Samba is installed, since the next step in my instructions tell me how to install and configure it. I've tried a few commands and I'm not sure what to do with the results or how to use them. I searched here and the technical details are above my capabilities and I don't think they address my seemingly simple need to find out if a package is installed or not. I tried: apt-cache dump this gave me way too much data. It scrolled down for a few minutes. I got this from The Raspberry Pi Handbook 3rd Edition (Link - Amazon) I tried apt-cache showpkg samba Package: samba Versions: 2:3.6.6-6+deb7u5 (/var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_ wheezy_main_binary-armhf_Packages) Description Language: File: /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_d ists_wheezy_main_binary-armhf_Packages MD5: 0122ac62ef5f4ae21eb2e195eb45ad1d Reverse Depends: winbind,samba 2.2.3-2 task-file-server,samba swat,samba 2:3.6.6-6+deb7u5 smbclient,samba 2.999+3.0.alpha21-4 samba4-common-bin,samba 2:3.3.0~rc2-5 samba4,samba 2:3.3.0~rc2-5 samba-dbg,samba 2:3.6.6-6+deb7u5 samba-common-bin,samba 3.0.20b-1 samba-common,samba 3.0.20b-1 qtsmbstatus-server,samba qemu-system,samba nautilus-share,samba 3.0.27a libwbclient0,samba 2:3.4.1 libpam-winbind,samba 2.2.3-2 libpam-smbpass,samba libnss-winbind,samba 2.2.3-2 gadmin-samba,samba education-main-server,samba dpsyco-samba,samba Dependencies: 2:3.6.6-6+deb7u5 - samba-common (5 2:3.6.6-6+deb7u5) libwbclient0 (5 2:3.6.6-6+d eb7u5) libacl1 (2 2.2.51-8) libattr1 (2 1:2.4.46-8) libc6 (2 2.13-28) libcap2 (2 2.10) libcomerr2 (2 1.01) libcups2 (2 1.4.0) libgcc1 (2 1:4.4.0) libgssapi-krb5 -2 (2 1.10+dfsg~) libk5crypto3 (2 1.6.dfsg.2) libkrb5-3 (2 1.10+dfsg~) libldap-2 .4-2 (2 2.4.7) libpam0g (2 0.99.7.1) libpopt0 (2 1.14) libtalloc2 (2 2.0.4~git20 101213) libtdb1 (2 1.2.7+git20101214) zlib1g (2 1:1.1.4) debconf (18 0.5) debcon f-2.0 (0 (null)) libpam-runtime (2 1.0.1-11) libpam-modules (0 (null)) lsb-base (2 3.2-13) procps (0 (null)) update-inetd (0 (null)) adduser (0 (null)) dpkg (2 1.15.7.2) openbsd-inetd (16 (null)) inet-superserver (0 (null)) smbldap-tools (0 (null)) ldb-tools (0 (null)) ctdb (0 (null)) logrotate (0 (null)) tdb-tools (0 (null)) samba4 (3 4.0.0~alpha6-2) samba-common (1 2.0.5a-2) Provides: 2:3.6.6-6+deb7u5 - Reverse Provides: pi@raspberrypi ~ $ apt-cache showpkg ntfs-3g Package: ntfs-3g Versions: 1:2012.1.15AR.5-2.1+deb7u2 (/var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_wheezy_main_binary-armhf_Packages) (/var/lib/dpkg/status) Description Language: File: /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_wheezy_main_binary-armhf_Packages MD5: b2df024e8627b5d253b85f35263376ef Reverse Depends: udisks,ntfs-3g ntfsprogs,ntfs-3g ntfs-config,ntfs-3g ntfs-3g-dev,ntfs-3g 1:2012.1.15AR.5-2.1+deb7u2 ntfs-3g-dbg,ntfs-3g 1:2012.1.15AR.5-2.1+deb7u2 kvpm,ntfs-3g fsarchiver,ntfs-3g Dependencies: 1:2012.1.15AR.5-2.1+deb7u2 - debconf (18 0.5) debconf-2.0 (0 (null)) libc6 (2 2.13-28) libfuse2 (2 2.8.1) libgcc1 (2 1:4.4.0) libgcrypt11 (2 1.4.5) libgnutls26 (2 2.12.17-0) multiarch-support (0 (null)) fuse (0 (null)) libntfs-3g75 (0 (null)) ntfsprogs (3 1:2011.10.9AR.1-3~) libntfs-3g75 (0 (null)) ntfsprogs (0 (null)) Provides: 1:2012.1.15AR.5-2.1+deb7u2 - Reverse Provides: pi@raspberrypi ~ $ apt-cache showpkg ntfsprogs Package: ntfsprogs Versions: 1:2012.1.15AR.5-2.1+deb7u2 (/var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_wheezy_main_binary-armhf_Packages) Description Language: File: /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_wheezy_main_binary-armhf_Packages MD5: 95f41af9cf1d0b5b66afb7d2a9e7c75d Reverse Depends: partitionmanager,ntfsprogs ntfs-3g,ntfsprogs ntfs-3g,ntfsprogs 1:2011.10.9AR.1-3~ gparted,ntfsprogs fsarchiver,ntfsprogs fai-setup-storage,ntfsprogs Dependencies: 1:2012.1.15AR.5-2.1+deb7u2 - ntfs-3g (0 (null)) Provides: 1:2012.1.15AR.5-2.1+deb7u2 - Reverse Provides: but I'm not sure what to make of the results. I can't tell if it's going to apt-get the servers and getting information, or pulling it from my system. I tried : dpkg --get-selections which I got from here: http://www.howtogeek.com/howto/linux/show-the-list-of-installed-packages-on-ubuntu-or-debian/?PageSpeed=noscript but I think I'm running into the same problem. It seems the syntax has changed since 2007. The man page / help file seems to lead me to believe that the command should work Usage: dpkg [ ...] --get-selections [ ...] Get list of selections to stdout. but I get an error: dpkg –get-selections samba dpkg: error: need an action option I found a few wuestions here that are related, but don't give me what I am looking for. I am interested in just knowing what's installed, but I guess that's a topic for another question. * https://unix.stackexchange.com/questions/90523/what-packages-are-installed-by-default-in-debian-is-there-a-term-for-that-set * https://unix.stackexchange.com/questions/113573/how-do-we-know-what-applications-are-installed-in-linux * https://unix.stackexchange.com/questions/180822/loop-to-check-whether-a-debian-package-is-installed-or-not * https://unix.stackexchange.com/questions/137295/determine-if-a-package-is-provided-by-an-installed-packagein-arch-linux
Asked by YetAnotherRandomUser (497 rep)
Jul 19, 2015, 10:26 PM
Last activity: Jul 7, 2025, 12:23 PM