dpkg -S

Debian and Ubuntu tip #1

You can use dpkg to figure out what package installed a file on your system. For instance, I don’t particularly like emacs so was suprised to find /etc/emacs is installed with a default Debian Etch install.
debian:~# dpkg -S /etc/emacs
dictionaries-common: /etc/emacs

To see more information about that package (to decide what to do with it). Use apt-cache show
debian:~# apt-cache show dictionaries-common
Package: dictionaries-common
Priority: standard
Section: text
Installed-Size: 745
Maintainer: Agustin Martin Domingo
Architecture: all
Version: 0.70.10
Replaces: openoffice.org-updatedicts
Provides: openoffice.org-updatedicts
Depends: perl-base (>= 5.6.0-16), debconf (>= 0.5) | debconf-2.0
Suggests: ispell, emacsen-common, jed-extra
Conflicts: ispell (<= 3.1.20.0-1), miscfiles (<< 1.3-2.1), iamerican (<= 3.1.20.0-1), ibrazilian (<< 2.4-5.1), ibritish (<= 3.1.20.0-1), ibulgarian (<= 2.0-2), icatalan (<= 0.1-4), iczech (<= 20020628-1), idanish (<< 1.4.22-2.1), idutch (<= 1:0.1e-20), iesperanto (<< 2.1.2000.02.25-6), ifaroese (<= 0.1.16-2), ifinnish (<< 0.7-3.4), ifinnish-large (<< 0.7-3.4), ifinnish-small (<< 0.7-3.4), ifrench (<= 1.4-13), ifrench-gut (<= 1:1.0-9), igerman, ihungarian (<= 0.84-1), iitalian (<< 2.20-1.2), ingerman (<< 20010414-2), inorwegian (<< 2.0-6.1), ipolish (<< 20011004-2.1), iportuguese (<< 19980611-8), irussian (<= 0.99f0-1), ispanish (<< 1.7-5), ispell-ga, iswedish (<= 1.4.2), wbritish (<= 3.1.20.0-1), wbulgarian (<= 2.0-2), wcatalan (<= 0.1-4), wdanish (<< 1.4.22-2.1), wdutch (<= 1:0.1e-20), wenglish (<= 2.0-2), wfaroese (<= 0.1.16-2), wfinnish (<< 0.7-3.4), wfrench (<= 1.0-11), wgerman, witalian (<= 1.6), wnorwegian (<< 2.0-6.1), wngerman (<< 20010414-2), wpolish (<< 20011004-2.1), wspanish (<= 1.0.11.1), wswedish (<= 1.4.2), openoffice.org-updatedicts
Filename: pool/main/d/dictionaries-common/dictionaries-common_0.70.10_all.deb
Size: 250004
MD5sum: e9a26a3367d2373a20368d1fe6b22a73
SHA1: 16730ac0cac691e5bd9a1edc123be83902214738
SHA256: 39ce6f1684a2b568e78467656bfdcd605dae20f588dc7544b08f03aaadd1e789
Description: Common utilities for spelling dictionary tools
These are utilities shared by all ispell, myspell and wordlist
dictionaries, including support for some tools that use ispell
(like emacsen, jed and mutt). More info about naming conventions and
availability of those dictionaries in the README file.
.
Maintainers should install dictionaries-common-dev as well, and read its
documentation.
Tag: implemented-in::lisp, implemented-in::perl, role::plugin, role::program, scope::utility, special::auto-inst-parts, works-with::dictionary

http://www.debian.org/doc/manuals/reference/ch-package.en.html

Which package does a file belong to? (RPM Style)

If you want to figure out which package a file belongs to you can use rpm to find out (On a system that uses rpm). Which package does /bin/bash belong to?


[root@host ~]# rpm -qf /bin/bash
bash-3.0-19.3

So /bin/bash belongs to bash-3.0-19.3

The -q option lets rpm know that you want to do a query of the database. The f lets you query the package containing the file you specify.

Here’s another query:


[root@host ~]# rpm -qf /usr/bin/xargs
findutils-4.1.20-7.el4.1
[root@host ~]#

yum lets you get info on the findutils package:


[root@host ~]# yum info findutils
Setting up repositories
update 100% |=========================| 951 B 00:00
rpmforge 100% |=========================| 1.1 kB 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Installed Packages
Name : findutils
Arch : i386
Epoch : 1
Version: 4.1.20
Release: 7.el4.1
Size : 231 k
Repo : installed
Summary: The GNU versions of find utilities (find and xargs).


Description:
The findutils package contains programs which will help you locate
files on your system. The find utility searches through a hierarchy
of directories looking for files which match a certain set of criteria
(such as a filename pattern). The xargs utility builds and executes
command lines from standard input arguments (usually lists of file
names generated by the find command).


You should install findutils because it includes tools that are very
useful for finding things on your system.

So, if you are using a system that uses RPM/YUM, you can easily find out the packages that files on your filesystem belong to.

Once you have identified the package that you are looking for you may wish to find out which files are part of that package. To do so you use the query list option (-ql). Here is an example for the bash package:


[dustin@host ~]$ rpm -ql bash
/bin/bash
/bin/sh
/etc/skel/.bash_logout
/etc/skel/.bash_profile
/etc/skel/.bashrc
/usr/bin/bashbug-32
/usr/share/doc/bash-3.0
/usr/share/doc/bash-3.0/CHANGES
--snip--
/usr/share/man/man1/unset.1.gz
/usr/share/man/man1/wait.1.gz
[dustin@host ~]$

Site restructuring

Moving to a WordPress site for easier multi-user blogging/writing with comments and other such neat schtuff. You can still access the MoinMoin wiki

  • February 2012
    M T W T F S S
    « Sep    
     12345
    6789101112
    13141516171819
    20212223242526
    272829  
  • Author

    A little something about you, the author. Nothing lengthy, just an overview.