1

Just downloaded and installed the libasound2-dev package using apt-get install

My gcc compile command now references alsa/asound.h correctly

But I just want to have a look at all the source files that were downloaded.

How do I find where they were installed?

I tried sudo dpkg -L for alsa and asound, but that was just an uneducated guess that failed. I imagine Debian installs these somewhere in /etc but I had no luck doing a manual search

There's probably some kind of ls / grep command that somebody knows off the top of their head? I'm very new at this Linux thing

I have a Raspberry Pi 3 with Jessie Lite installed

1

The packages that you install with apt-get are download in the form of ".deb" files. The .deb files for packages you've already installed live in /var/cache/apt/archives. You could look for recently installed packages in there, with ls -ltrc /var/cache/apt/archives

Once you find the appropriate .deb file, you can list the files it contains (that is, the files that will/did get installed into the filesystem, vs. the various other control files in the .deb), like this:

dpkg-deb -c /var/cache/apt/archives/vim/libasound2-dev_1.0.28-1+rpi1_armhf.deb

You can also download .deb files for packages that are not installed, using, e.g. apt-get download libasound2-dev. This downloads to the current directory. I often combine this with dbpkg-deb -c to download some package into /tmp and check what it would install (say you're faced with several related packages, and you're really just after one binary that some script needs - you can figure out which of the several packages to install by downloading them all and listing their contents).

Edited to add:

You can get a copy of exactly what would have been installed like this:

cd /tmp
apt-get download libasound2-dev
ls -ltrc
# ls shows that apt-get downloaded "libasound2-dev_1.0.28-1+rpi1_armhf.deb")
mkdir foo
dpkg-deb -X libasound2-dev_1.0.28-1+rpi1_armhf.deb foo
ls -FR foo

At this point, you can peruse the contents of "foo" - compare the files there to what is currently installed in your system; check the names, lengths, timestamps, and checksums (md5sum is good, but cksum is sufficient for a sanity check), to see if what currently resides on your system matches a given package.

  • I've cleaned out the cache. I did find the libraries in /usr/lib/arm-linux-gnueabihf - but not sure if there's a way to tell what version it is. Extension is .2.0.0 - that doesn't seem to match with the latest being 1.0.28 – dbmitch Jul 10 '16 at 20:51
  • 1
    You might also try looking at /var/log/apt/history.log and /var/log/apt/term.log and their older gzipped brethren to see what version of the package got installed, – CarlRJ Jul 10 '16 at 21:20
  • (Added another suggestion to my original answer.) – CarlRJ Jul 10 '16 at 21:54
  • What I really want is version numbers for installed packages - if I can find a match - I'll try grepping the history. Thanks – dbmitch Jul 10 '16 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.