dpkg question

der.hans plug-discuss@lists.PLUG.phoenix.az.us
Mon, 30 Apr 2001 12:10:42 -0700 (MST)


Am 30. Apr, 2001 schwäzte William Karl so:

> I'm just starting out with Debian and I have a question about its
> package management system. There is a feature in gnome-apt that I use
> to search for a given package on the server. It tells me what version
> is installed, what version can be installed (latest), and some
> dependency info. Is there any way that I can find this stuff out via
> dpkg? I only use gnome-apt to search for packages, I use apt-get or
> dpkg to remove/install them. I'd like to cut out the gnome-apt step
> (esp. over ssh from home).

Don't know about dpkg, but I think apt-cache is what you want.

apt-cache search ^task

That'll bring up all of the task packages.

Here are the debian things I use regularly:

apt-get update
	Gets new package lists.

apt-get -u dist-upgrade
	Upgrades to new versions, also updates dist changes, e.g. if the
default ftpd was wu-ftpd, but is now proftpd it will uninstall wu-ftpd and
install proftpd. The -u tells it to list which packages are being updated.

apt-get install <package>
	Installs said package and dependencies.

apt-cache search <regex>
	Searched through the package lists on the local machine for said
regex.

dpkg -S <regex>
	Searches the package database for packages owning files matching
said regex. I believe this doesn't catch files that were created,
e.g. some config files, cache files, sockets, etc. Unfortunately a lot of
files fall through the cracks, but all binaries should be identifiable.

dpkg --configure -a
	Sometimes apt-get install/dist-upgrade blows up. It tells you to
run this, which configs packages that were installed, but not yet
configured. Then you can run apt-get install/dist-upgrade again.

dpkg -i <package_file>
	Installs said package_file.

> Second question: 
> I'm trying to install Lynx on my machine. When I do an apt-get install lynx
> it prompts me for the CD. Shouldn't it just get this package from the
> server? Why is it asking for the CD. I have no CD entry in
> /etc/apt/sources.list. 

It's finding the most recent release to be on the CD, not on the net.

Have you run apt-get update since taking the CD out of
/etc/apt/sources.list? Do you have the right sources listed?

deb http://http.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib
non-free
deb http://security.debian.org stable/updates main contrib non-free

# Uncomment if you want the apt-get source function to work
deb-src http://http.us.debian.org/debian stable main contrib non-free
#deb-src http://non-us.debian.org/debian-non-US stable non-US


$ grep lynx_ /var/lib/apt/lists/*Packages | grep -v source
/var/lib/apt/lists/http.us.debian.org_debian_dists_stable_main_binary-i386_Packages:Filename: dists/potato/main/binary-i386/web/lynx_2.8.3-1.deb

So it's in http.us.

$ grep lynx-ssl_ /var/lib/apt/lists/*Packages | grep -v source
/var/lib/apt/lists/non-us.debian.org_debian-non-US_dists_stable_non-US_main_binary-i386_Packages:Filename: dists/potato/non-US/main/binary-i386/lynx-ssl_2.8.3.1-1.deb

lynx-ssl is in non-US, though.

BTW, I note that package lists were in /var/lib/state/apt on potato, but
have moved to /var/lib/apt for woody.

ciao,

der.hans
-- 
# der.hans@LuftHans.com home.pages.de/~lufthans/ www.YourCompanyHere.net ;-)
#  Practice socially consious hedonism. Do whatever you want,
#  as long as it doesn't hurt anyone else. - der.hans