DebfosterHowto

出自Ubuntu中文

目录

Debfoster 使用指南

原文出处:

原文作者:

授权许可:

翻译人员:yongyi

校正人员:MillenniumDark

贡献人员:watertest

适用版本: 文章状态:翻译完成



Hi,

This is not for the faint of heart so fresh baked noobs get away!

This is my first HOWTO. I noticed I was explaining debfoster a lot and I wanted to have a link to it. debfoster is a very powerful tool once you are getting used to it. I've thought up five scenarios of use :

  • SCENARIO 1)You use it to keep track of what you did install
  • SCENARIO 2)You want to make your system clean,mean and lean.
  • SCENARIO 3)You have had problems with upgrading to hoary or you have entered a dependencies hell on accident.
  • SCENARIO 4)You want an internet gateway with a nice windowmanager that uses little resources.
  • SCENARIO 5)You want to remove all of kde and kubuntu and go back to ubuntu-desktop

Hi, 这不是为胆小鬼而设的,所以请刚刚烘焙的noobs离开!

这是我第一个HOWTO。我注意到我解释debfoster很多,所以我要为它做一个链接。一旦你习惯了它,debfoster会是一个非常强大的工具。我设计出五种使用方案:

  • 方案1)使用它去了解你安装了什么。
  • 方案2)你想使你的系统变得干净、平均和纤瘦的。
  • 方案3)在升级到hoary上你遇到了问题,或者你不小心陷入了依赖困境。
  • 方案4)你想要一个占资源少又有着漂亮窗口管理器的internet网关。
  • 方案5)你想卸载kde和kubuntu全部文件,并回到ubuntu-desktop。
apt-cache show debfoster : 

Description: Install only wanted Debian packages 
debfoster is a wrapper program for apt and dpkg. When first run, it 
will ask you which of the installed packages you want to keep 
installed. 
. 
After that, it maintains a list of packages that you want to have 
installed on your system. It uses this list to detect packages that 
have been installed only because other packages depended on them. If 
one of these dependencies changes, debfoster will take notice, and 
ask if you want to remove the old package. 
. 
This helps you to maintain a clean Debian install, without old 
(mainly library) packages lying around that aren't used any more. 

说明:安装只需要Debian软件包 
debfoster是一个apt和dpkg的包装程序。第一次运行 ,它会问你想保留哪些已经安装的软件包。 

之后,它会保存一张你系统已安装的软件包列表。它利用这张列表去探测已经安装的软件包,仅仅因为其他软件包依赖于他们。 
当其中一个依赖改变,debfoster会提醒你,并询问你是否要移走旧的软件包。 

这帮助你保持一个干净的Debian,没有不再使用到的旧(主要的软件库)软件包隐藏于其中。
man debfoster : 

debfoster - weed unnecessary Debian packages 

debfoster maintains a list of installed packages that were explicitly requested rather than installed as a dependency. Arguments are entirely optional, debfoster can be invoked per se after each run of dpkg and/or apt-get. 

Alternatively you can use debfoster to install and remove packages by specifying the packages on the command line. Packages suffixed with a - are removed while packages without a suffix are installed. 

If a new package is encountered or if debfoster notices that a package that used to be a dependency is now an orphan, it will ask you what to do with it. If you decide to keep it, debfoster will just take note and continue. If you decide that this package is not interesting enough it will be removed as soon as debfoster is done asking questions. If your choises cause other packages to become orphaned more questions will ensue. 

debfoster──除去不必要的Debian软件包 

debfoster 保存一个明确要求安装而不是作为依赖安装的软件包列表。参数是完全自由选择的,在第一次运行dpkg和/或ap-get后,debfoster都可以被唤出。 

作为选择,通过在命令行指定软件包,你可以用debfoster去安装和卸载软件包。加了一个-后缀的软件包是被卸载的,同时,没有后缀的是被安装的。 

如果遇到一个新的软件包,或debfoster发现曾经被作为依赖的一个软件包现在成为一个孤体,它会询问你要怎么处理它。如果你决定保留它,debfoster将做记录并继续下去。如果你决定这个软件包不够令人感兴趣,debfoster一问完问题,它就将会被卸载。如果你的选择引起其他软件包变成孤体,更多问题将会接踵而来。 


to install debfoster :

安装debfoster:

 
sudo apt-get install debfoster 

EVERYTHING IN THIS HOWTO IS AT YOUR OWN RISK. You should understand what you are doing and also read the manpage($ man defoster) before doing any commands. If you do the following things the risk will be minimal.

-There is one very IMPORTANT thing. ALWAYS MAKE SURE THAT THE PACKAGE ubuntu-base IS MENTIONED IN YOUR KEEPERS FILE! Never choose to purge it when run debfoster from the commandline! This will render your system unusable.

-Be sure to to never remove the kernel you are currently running from your keepers file. Removing it probably won't succeed but if it will succeed (and you have no other kernels available in your grub menu then it will be a pain to boot the correct kernel)

-don't remove the grub package!

-Also be sure that you backup important configuration files that you have edited yourself!

-If you decide to do it and this is your only box. It would be handy to keep a live-cd aside in case you run into troubles

-it's nice if you leave debfoster in the keepers file otherwise it might try to remove itself

这个HOWTO的任何事情都是自担风险的。你应该知道你正在做什么,并且在执行任何命令前阅读 manpage($ man debfoster)。如果你做下面的事情,风险将会减到最低。


-这里有一件非常重要的事情。始终确保在你的deepers文件中有ubuntu-base软件包!当你在命令行运行debfoster,永远不要选择清除它!这会致使你的系统不可用的。

-确保永不从你的deepers文件中移走你现在正在运行的核心。也许不会成功移走它。但如果它成功,并在你的grub菜单没有其他可用的核心,那么,启动现在的核心将会是痛苦的事情。

-不要移走grub软件包!

-也确保你备份了那些你自己编辑过的重要配置文件!

-如果你决定做下去,并且这是你唯一的系统。为了方便使用,另外保留一张live-cd来以防你运行时遇到麻烦。

-如果你保留debfoster在deepers文件中,那就做对了。否则它会尝试移走自己。

SCENARIO 1)You use it to keep track of what you did install

方案1)使用它去了解你安装了什么。

to install debfoster type :

安装debfoster,输入:

$ sudo apt-get install debfoster 

to create the initial keepers file type :

建立最初的keepers文件,输入:

$ sudo debfoster -q 

to edit the keepers file type :

编辑keepers文件,输入:

$ sudo pico /var/lib/debfoster/keepers 

NEVER remove your current kernel (for example linux-686) and ubuntu-base

Also be sure that you backup important configuration files that you have edited yourself!

To force debfoster to remove all packages that aren't listed in this list or dependencies of packages that are listed in this list.It will also add all packages in this list that aren't installed. So it makes your system comply with this list. Do this :

永远不移走你现在的核心(如linux-686)和ubuntu-base

也要确保你备份了那些你自己编辑过的重要配置文件!

为了强制debfoster移走没在列表中列出的所有软件包,或者列表中这些软件包的依赖。(它也将添加列表中所有还没安装的软件包。因此,它会使你的系统遵守这一列表。)执行这个:

$ sudo debfoster -f 

from the manpage of debfoster :

来自debfoster的manpage:

 
-f, --force

Don’t ask anything and assume ‘no’ as the answer to all questions. It also installs any packages that seem to be missing, thus forcing your 
system to comply with the debfoster database. Can have ‘interesting’ results if you’re not careful. 
-f, --force 
不会询问什么,并假定所有问题的答案都是“no”。如此强制你的系统利用debfoster数据库去完成工作,它也安装任何似乎缺少的软件包。如果你不小心,可能会有“有趣的”结果。


To keep track of what you installed additionally do once in a while :

马上了解一下你一次额外安装了什么:

$ sudo debfoster 

type i for info, h for help, p for purge, y for remove and n for not remove

键入i是信息,h是帮助,p是清除,y是移走,n是不移走。FootNote(man了一下debfoster ,y是keep,保留 ,n是delete,删除 ,英文原文就弄反了. --watertest)


SCENARIO 2)You want to make your system clean,mean and lean.

basically the same as scenario 1 but I want to add these comments :

ubuntu-base,ubuntu-desktop are the metapackages that all other packages depend on when you first install ubuntu.

This cleans your apt-get cache this can be a lot of space if you never do apt-get clean :

方案2)你想使你的系统变得干净、平均和纤瘦的。 基本上跟方案1 一样,但我想增加说明这些: 当你第一次安装ubuntu,ubuntu-base,ubuntu-desktop是所有其他软件包依赖的母体软件包。

这是清理你的apt-get缓存的,如果你从来没执行过apt-get clean,这能清理出很多空间:

$ sudo apt-cache clean 

deborphan is also very nice.

deborphan也是很好用的。

 
$ sudo apt-get install deborphan 

To find leftover configuration files :

寻找残余的配置文件:

$ deborphan --find-config 

To find all orphans (only remove things you are sure about!) :

寻找所有的孤体(只移走你确定的东西!):

$ deborphan -a 

xdiskusage is nice if you want to easily see where the space on your harddrive goes

如果你想很容易地看到你的硬盘哪里有空间,那xdiskusage会适合你:

$ sudo apt-get install xdiskusage 

$ sudo xdiskusage 


SCENARIO 3)You have had problems with upgrading to hoary or you have entered a dependencies hell on accident.

在升级到hoary上你遇到了问题,或者你不小心陷入了依赖困境。

FIXME 给出相应的中文资料的链接,并且将内容替换为6.06或者其他合适的发行版的内容。

First go read :

首先阅读:

www.ubuntuguide.org www.ubuntulinux.org/wiki/guidetohoary http://www.ubuntulinux.org/wiki/HoaryUpgradeNotes



Make sure your /etc/apt/sources.list is the same as the one on : 确定你的/etc/apt/sources.list上有一项跟这相同:

www.ubuntulinux.org/wiki/guidetohoary 

You should search the forums about your specific problem. Here's a relevant thread about upgrading to hoary :

对于你特别的问题,你应该在论坛搜索。这里是一个与升级到hoary相关的线索: http://ubuntuforums.org/showthread.php?t=23624

So you have screwed up your box? The easiest way out of this mess is ofcourse reinstalling when hoary gets released. But that isn't fun.

Okay here we go :

Install debfoster by :

因此你已经对你的系统感到烦乱?跳出这困境的最简单方法当然是,当hoary释放时重新安装。但这并不是有趣的。


好了,我们就开始: 安装debfoster:

 
$ sudo apt-get install debfoster 

edit your keepers file by :

编辑你的keepers文件:

$ sudo pico /var/lib/debfoster/keepers 

It should look at like this (assuming you are on a 686 processor and using grub) :

它看起来应该像这样(假设你的是686处理器和使用grub):


ubuntu-base 
linux-686 
debfoster 
grub 

You should remove all other lines.

你应该移走其他行。 Now we go to init 1. To make sure we don't harm processes that are running.

现在我们前往init 1。确认我们不会损害正在运行的进程。

$ sudo init 1 

Also be sure that you backup important configuration files that you have edited yourself!

To force debfoster to remove all packages that aren't listed in this list or dependencies of packages that are listed in this list.It will also add all packages in this list that aren't installed. So it makes your system comply with this list. Do this :

也要确保你备份了那些你自己编辑过的重要配置文件!


为了强制debfoster移走没在列表中列出的所有软件包,或者列表中这些软件包的依赖。(它也将添加列表中所有还没安装的软件包。因此,它会使你的系统遵守这一列表。)执行这个:

$ sudo debfoster -f 

from the manpage of debfoster :

来自debfoster的manpage:

-f, --force 
Don’t ask anything and assume ‘no’ as the answer to all questions. It also installs any packages that seem to be missing, thus forcing your system to comply with the debfoster database. Can have ‘interesting’ results if you’re not careful. 
-f, --force 
不会询问什么,并假定所有问题的答案都是“no”。如此强制你的系统利用debfoster数据库去完成工作,它也安装任何似乎缺少的软件包。如果你不小心,可能会有“有趣的”结果。 


After this your system is compatible with the keepers file.

Now install ubuntu-desktop and xserver-xorg by :

这之后,你的系统就与keepers文件兼容的。现在安装ubuntu-desktop和xserver-xorg:

sudo apt-get install ubuntu-desktop xserver-xorg 

To start your gdm / gnome again do this :

执行这个来重启你的gdm/gnome:

$ sudo init 2 

if gdm doesn't start do :

如果gdm不能启动,执行:

$ startx 

if it still doesn't start you should :

backup your /etc/X11/xorg.conf by :

如果它仍然不能启动,你应该: 备份你的/etc/X11/xorg.conf:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak 

reconfigure your xserver by :

重新配置你的xserver:

 
$ sudo dpkg-reconfigure xserver-xorg 

try to start gdm/gnome again by :

尝试再次重启gdm/gnome:

$ startx 

if it still doesn't start you should edit your xorg.conf by hand to solve the problem :

如果它仍然不能启动,你应该手动编辑你的xorg.conf去解决问题:

$ sudo pico /etc/X11/xorg.conf 

or post in the forums for help and include your /var/log/Xorg.0.log

To keep track of what you installed additionally do once in a while :

或者在论坛发帖寻求帮助,并包含你的/var/log/Xorg.0.log

马上去了解一下你一次额外安装了什么:

$ sudo debfoster 

type i for info, h for help, p for purge, y for remove and n for not remove

键入i是信息,h是帮助,p是清除,y是移走,n是不移走。FootNote(man了一下debfoster ,y是keep,保留 ,n是delete,删除 ,英文原文就弄反了. --watertest)


SCENARIO 4)You want an internet gateway with a nice windowmanager that uses little resources.

方案4)你想要一个占资源少又有着漂亮窗口管理器的internet网关

I've played enough with xfce4 to feel confident to use it as my only desktop-environment on my internet gateway/fileserver (using xfwm4 and vncserver

It's install size is only 771 mb in /. /home is mounted on a different partition. I've also got installed J2SE and hugin lite (but not from packages). I "downgraded" my ubuntu-base / ubuntu-desktop configuration using debfoster.

I use it for:

-downloading -working at my own pc from school using vncserver -fileserver using samba

this is my /var/lib/debfoster/keepers :

我已经摆弄xfce4足够时间了,有信心在我的internet 网关/文件服务器(正使用xfwm4和vncsever)上使用它作为我唯一的桌面环境。

它安装在./的大小只有771mb,./home挂载在另外一个分区。我也安装了J2SE和hugin lite(但不是从软件包)。我利用debfoster去“降级”我的ubuntu-base/ubuntu-desktop配置。

我用它来: -下载 -从学校通过vncserver在我自己的电脑上工作 -samba文件服务器

这是我的 /var/lib/debfoster/keepers :


amule 
cgoban 
debfoster 
deborphan 
firestarter 
flashplayer-mozilla 
gaim 
gnugo 
grub 
grubconf 
isag 
linux-686 
mozilla-firefox 
nmap 
prelink 
python 
raidtools2 
samba 
slocate 
smbfs 
ssh 
swf-player 
ubuntu-base 
unrar 
vncserver 
xdiskusage 
xfce4 
xfce4-goodies 
xfwm4 
xserver-xorg 

Okay here we go :

Install debfoster by :

好了,我们开始:

安装debfoster:

$ sudo apt-get install debfoster 

This is to create your initial keepers file :

用这个建立你最初的keepers文件:

 
$ sudo debfoster -q 

Now edit your keepers file :

现在编辑你的keepers文件:

$ sudo pico /var/lib/debfoster/keepers 

And change it to at least (IMO for this scenario) : 并将它改为至少包含以下几项(这是我的个人意见):


debfoster 
deborphan 
firestarter 
gaim 
grub 
linux-686 
mozilla-firefox 
prelink 
samba 
slocate 
smbfs 
ssh 
ubuntu-base 
xfce4 
xfce4-goodies 
xfwm4 
xserver-xorg 

Also include your favorite applications.Be sure not to forget the ones you have already configured because all packages that are not listed will be removed completly (including configuration files). GNOME applications look really nice in XFCE4! I haven't checked kde applications but they should also work nicely.

Now we go to init 1. To make sure we don't harm processes that are running.

同样地包括你喜爱的应用程序。确保不要忘记你已经配置的其中一个,因为所有没列出的软件包都将会完全移走(包括配置文件)。 Gnome应用程序在Xfce4中看起来真的非常好!我没有尝试KDE应用程序,但他们应该也会工作得不错的。

现在我们前往init 1。确认我们不会损害正在运行的进程。

$ sudo init 1 

Also be sure that you backup important configuration files that you have edited yourself!

To force debfoster to remove all packages that aren't listed in this list or dependencies of packages that are listed in this list.It will also add all packages in this list that aren't installed. So it makes your system comply with this list. Do this :

也要确保你备份了那些你自己编辑过的重要配置文件!

为了强制debfoster移走没在列表中列出的所有软件包,或者列表中这些软件包的依赖。(它也将添加列表中所有还没安装的软件包。因此,它会使你的系统遵守这一列表。)执行这个:

$ sudo debfoster -f 

from the manpage of debfoster :

来自debfoster的manpage:

-f, --force 
Don’t ask anything and assume ‘no’ as the answer to all questions. It also installs any packages that seem to be missing, thus forcing your 
system to comply with the debfoster database. Can have ‘interesting’ results if you’re not careful. 
-f, --force 
不会询问什么,并假定所有问题的答案都是“no”。如此强制你的系统利用debfoster数据库去完成工作,它也安装任何似乎缺少的软件包。如果你不小心,可能会有“有趣的”结果。


After this your system is compatible with the keepers file.

这之后,你的系统就与keepers文件兼容的。

To start your xfce4 and enter init level 2 do this :

为了启动你的xfce4,和进入init 2,执行这个:

$ sudo init 2 

if xfce4 doesn't start do :

如果xfce4不能启动,则执行:

$ startxfce4 

if it still doesn't start you should :

backup your /etc/X11/xorg.conf by :

如果它仍然不能启动,你应该: 备份你的/etc/X11/xorg.conf:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak 

reconfigure your xserver by :

重新配置你的xserver:

$ sudo dpkg-reconfigure xserver-xorg 

try to start xfce4 again by :

尝试再次启动xfce4:

$ startxfce4 

if it still doesn't start you should edit your xorg.conf by hand to solve the problem :

如果它仍然不能启动,你应该手动编辑你的xorg.conf去解决问题:

$ sudo pico /etc/X11/xorg.conf 

or post in the forums for help and include your /var/log/Xorg.0.log

To keep track of what you installed additionally do once in a while :

或者在论坛发帖寻求帮助,并包含你的/var/log/Xorg.0.log

马上了解一下你一次额外安装了什么:

$ sudo debfoster 

type i for info, h for help, p for purge, y for remove and n for not remove

键入i是信息,h是帮助,p是清除,y是移走,n是不移走。FootNote(man了一下debfoster ,y是keep,保留 ,n是delete,删除 ,英文原文就弄反了. --watertest)

To configure samba and learn more about it please check www.ubuntuguide.org

see here for how to configure prelink :

想配置samba和学习更多的有关知识,请检查www.ubuntuguide.org

看这里,有关怎么配置prelink:

http://www.ubuntuforums.org/showthr...ghlight=prelink


SCENARIO 5)You want to remove all of kde and kubuntu and go back to ubuntu-desktop

方案5)你想卸载kde和kubuntu全部文件,并回到ubuntu-desktop。

Install debfoster by :

安装debfoster:

$ sudo apt-get install debfoster 

to build the keepers file without asking questions :

不询问问题建立keepers文件:

$ sudo debfoster -q 

and edit your keepers file by :

并编辑你的keepers文件:

$ sudo pico /var/lib/debfoster/keepers 

It should look at least like this (assuming you are on a 686 processor and using grub) :

它看起来至少像这样(假设你的是686处理器和使用grub):

ubuntu-base 
ubuntu-desktop 
linux-686 
xserver-xorg 
debfoster 
grub 

Also include your favorite applications.Be sure not to forget the ones you have already configured because all packages that are not listed will be removed completly (including configuration files).

You should remove kubuntu-desktop and all packages that start with the letter k that you know belong to kde and don't want anymore. If your kubuntu-desktop is broken and doesn't show up don't worry it's just a meta-package. Be sure to remove kdebase,kdm,kdelibs,kdelibs4 if they are mentioned in the keepers file. Also please keep all applications that are mentioned in the keepers file and that you do use. You should remove all other lines you are not sure of.

Now we go to init 1. To make sure we don't harm processes that are running.

同样地包括你喜爱的应用程序。确定不要忘记你已经配置的其中一个,因为所有没列出的软件包都将会完全移走(包括配置文件)。

你将要移走kubuntu-desktop和所有以k开头的、你知道是属于KDE并且不再需要的软件包。如果你的kubuntu-desktop破坏了,并且没有显示出来,别担心,它只是一个母体软件包。

确保移走kdebase,kdm,kdelibs,kdelibs4,如果他们在keepers文件里提到。也请保留所有在keepers文件提到并且你要使用的应用程序。你应该移走所有其他你不确定的行。

现在我们前往init 1。确认我们不会损害正在运行的进程。

$ sudo init 1 

Also be sure that you backup important configuration files that you have edited yourself!

To force debfoster to remove all packages that aren't listed in this list or dependencies of packages that are listed in this list.It will also add all packages in this list that aren't installed. So it makes your system comply with this list. Do this :

也要确保你备份了那些你自己编辑过的重要配置文件!

为了强制debfoster移走没在列表中列出的所有软件包,或者列表中这些软件包的依赖。(它也将添加列表中所有还没安装的软件包。因此,它会使你的系统遵守这一列表。)执行这个:

$ sudo debfoster -f 

from the manpage of debfoster :

来自debfoster的manpage:

-f, --force 
Don’t ask anything and assume ‘no’ as the answer to all questions. It also installs any packages that seem to be missing, thus forcing your 
system to comply with the debfoster database. Can have ‘interesting’ results if you’re not careful. 
-f, --force 
不会询问什么,并假定所有问题的答案都是“no”。如此强制你的系统利用debfoster数据库去完成工作,它也安装任何似乎缺少的软件包。如果你不小心,可能会有“有趣的”结果。 


After this your system is compatible with the keepers file.

To start your gdm / gnome again do this :

这之后,你的系统就与keepers文件兼容的。

执行这个来重启你的gdm/gnome:

$ sudo init 2 

if gdm doesn't start do :

如果gdm不能启动,执行:

$ startx 

if it still doesn't start you should :


backup your /etc/X11/xorg.conf by :


如果它仍然不能启动,你应该:

备份你的/etc/X11/xorg.conf:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak 

reconfigure your xserver by :

重新配置你的xserver:

$ sudo dpkg-reconfigure xserver-xorg 

try to start gdm/gnome again by :

重新配置你的xserver:

$ startx 

if it still doesn't start you should edit your xorg.conf by hand to solve the problem :

如果它仍然不能启动,你应该手动编辑你的xorg.conf去解决问题:

$ sudo pico /etc/X11/xorg.conf 

or post in the forums for help and include your /var/log/Xorg.0.log

To keep track of what you installed additionally do once in a while :

或者在论坛发帖寻求帮助,并包含你的/var/log/Xorg.0.log

马上了解一下你一次额外安装了什么:

$ sudo debfoster 

type i for info, h for help, p for purge, y for remove and n for not remove

键入i是信息,h是帮助,p是清除,y是移走,n是不移走。FootNote(man了一下debfoster ,y是keep,保留 ,n是delete,删除 ,英文原文就弄反了. --watertest)