[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I have instaledl too many packages



Hello,

> hi,all
>   I am a debian newbie.I have installed too may packages.
>   I  want to use 'dselect' to delete some,but show many errors
>   I want to use 'apt-get remove filename' but not know exactly the
>   filename,and there are so many package to remove.
>   How can I  reinstall but keep the smallest base system  so that I
>   not need to reboot and can use apt-get,deselect,netconfig etc.

dselect, apt-get, and the other stuff is great, but a little confusing
if you don't really know how the package management system works.  A
new user needs to learn two things at the same time, the basic system
and the user friendly wrapper.

Instead of reinstalling, you may want to look in /usr/share/doc (every
package creates a directory with the same name as the package) and
start removing _applications_ you don't want.

Use:
	dpkg --purge <package-names>

instead of dselect or apt, they call dpkg to do the removal anyways,
and you will get to see what kind of output dpkg produces - this is
important because it allows you to discriminate between actual errors
with packages, and cases where the user friendly tool is trying to
impose it's idea of the right thing to do (which I suspect is the
case with the "many errors" you mention in relation to dselect).

When you run into something you can't solve... use the "script"
command to make a transcript of what you are doing (start script, do
the dpkg command, do CTRL-D, mail the output to the list).

[warning: may require installing yet another package :)]
If you don't mind doing a little editing... you can have access to
dpkg and a reasonably user-friendly interface.  Is "git" (a text based
filesystem browser) installed.
When it is, do the following (as root)...

	# backup the config file, it maybe in /usr/share/git
	cp /usr/lib/git/{.gitrc.common,.gitrc.common.orig}

edit .gitrc.common so it includes this line in the
[GIT-Keys] section:

^C^Dp = DPKG-purge; dpkg --purge %s{Purge package: ,%d}

What this does is define the key press sequence

	CTRL-C CTRL-D p

to "dpkg --purge <package>", where <package> is whatever directory the
cursor is at, and you get a chance to edit the package name (most
likely to change it into a list of package names).

Personally, I prefer:

^C^Dp = DPKG-purge; dpkg --purge %i

because it allows you to select multiple directories and purge the
associated packages with a single dpkg command, no option to edit what
is being purged though.

Here are a few others (to get you started ;)...

^C^Ds = DPKG-status; dpkg -s %d
^C^DS = DPKG-search; dpkg -S %f
^C^Dl = DPKG-list; dpkg -l | $GIT_PAGER
^C^DL = DPKG-listfiles; dpkg -L %s{List files in package: ,%d} | $GIT_PAGER
^C^Dc = DPKG-configure; dpkg --configure %s{Configure package(s): ,--pending}
^C^Dr = DPKG-remove; dpkg -r %s{Remove package: ,%d}

Putting:

export GIT_PAGER=less
eval `lesspipe`

in ~/.bash_profile makes the ^Xv GIT key sequence more useful than the
default settings.

I've found the combination of GIT + dpkg specific key sequence
definitions (essentially using /usr/share/doc as a menu) as the most
effective way to snoop around the system with an eye to getting rid of
installed packages.

Have fun.


- Bruce



Reply to: