[aklug] Re: Ubuntu MySQL package

From: James Zuelow <e5z8652@zuelow.net>
Date: Sun Nov 01 2009 - 15:28:40 AKST

On Sunday 01 November 2009, Joshua J. Kugler wrote:
> On Sunday 01 November 2009, Damien Hull said something like:
> > Using aptitude gives me a better result but there's no my.cnf file.
> > Does anyone know what's going on here? I'm dead in the water until I
> > figure this out.
>
> Also remove (purge) mysql-common.
>
> j

By the way Damien, the command you're looking for is dpkg.

When you know where a file is, but don't know what package put it there, use
`dpkg -S /foo/bar`

So for example:

james@independence:~$ dpkg -S /etc/mysql/my.cnf
mysql-common: /etc/mysql/my.cnf

Or, if you're not sure what files are in a certain package, use `dpkg -L foo`

For example:

james@independence:~$ dpkg -L mysql-server | grep my.cnf
james@independence:~$

shows you that the my.cnf file isn't in mysql-server.

You can chain that with `dpkg -l | grep foo` to recursively search multiple
package things like mysql:

james@independence:~$ for package in `dpkg -l | grep mysql | awk ' { print
$2 } '`
> do
> echo $package
> dpkg -L $package | grep my.cnf
> done
libdbd-mysql-perl
libmysqlclient15off
libqt4-sql-mysql
mysql-admin
mysql-client-5.0
mysql-common
/etc/mysql/my.cnf
mysql-gui-tools-common
mysql-query-browser
mysql-server
mysql-server-5.0
james@independence:~$

When you scan the list you'll see the grep result after mysql-common.

Unfortunately you can't use dpkg -L on packages you haven't already installed,
which would be really cool if somehow you got mysql-server installed without
having mysql-common installed. (In which case the packages really would be
broken!)

Anyway, dpkg is quite useful. The last example here is sort of contrived to
answer your original question, but you can see the usefulness when you want
to figure out what deb package owns what files on your machine.

Cheers,

James
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sun Nov 1 15:29:05 2009

This archive was generated by hypermail 2.1.8 : Sun Nov 01 2009 - 15:29:05 AKST