Results 1 to 10 of 18

Thread: HOWTO: using debfoster in practice

Threaded View

  1. #1
    Join Date
    Oct 2004
    Location
    Netherlands
    Beans
    2,983
    Distro
    Ubuntu 8.04 Hardy Heron

    HOWTO: using debfoster in practice

    Hi,

    I'm posting this as a forum user and not as a staff member. First read and understand the entire post before doing anything. This is all on your own risk. Please be careful

    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

    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.

    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.
    to install 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

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

    to install debfoster type :
    $ sudo apt-get install debfoster

    to create the initial keepers file type :
    $ sudo debfoster -q

    to edit the keepers file type :
    $ 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 :

    $ sudo debfoster -f

    from the manpage of debfoster :
    -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.
    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

    ================================================== ==========================================


    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 :
    $ sudo apt-cache clean


    deborphan is also very nice.
    $ 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
    $ sudo apt-get install xdiskusage

    $ sudo xdiskusage

    ================================================== ============================================


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

    First go read :

    http://www.ubuntulinux.org/wiki/BreezyUpgradeNotes
    http://www.ubuntulinux.org/wiki/BreezyUpgrade
    [url]http://www.linux.com/article.pl?sid=05/10/12/1952217[/ur]

    You can use my sources.list if you like :
    http://www.ubuntuforums.org/showthread.php?t=87946

    You should search the forums about your specific problem. Here's a relevant thread about upgrading to 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 :
    $ sudo apt-get install debfoster

    edit your keepers file by :

    $ sudo pico /var/lib/debfoster/keepers

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

    Code:
    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.
    $ 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 :

    $ sudo debfoster -f

    from the manpage of debfoster :
    -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.
    After this your system is compatible with the keepers file.

    Now install ubuntu-desktop and xserver-xorg by :

    sudo apt-get install ubuntu-desktop xserver-xorg

    To start your gdm / gnome again do this :

    $ sudo init 2

    if gdm doesn't start do :

    $ startx

    if it still doesn't start you should :

    backup your /etc/X11/xorg.conf by :
    suco cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

    reconfigure your xserver by :
    $ sudo dpkg-reconfigure xserver-xorg

    try to start gdm/gnome again by :

    $ startx

    if it still doesn't start you should edit your xorg.conf by hand to solve the problem :
    $ 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 :

    $ sudo debfoster

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

    ================================================== ===========================================

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

    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 :

    Code:
    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 :
    $ sudo apt-get install debfoster

    This is to create your initial keepers file :

    $ sudo debfoster -q

    Now edit your keepers file :

    $ sudo pico /var/lib/debfoster/keepers

    And change it to at least (IMO for this scenario) :

    Code:
    debfoster
    deborphan
    firestarter
    gaim
    grub
    linux-686
    mozilla-firefox
    prelink
    samba
    slocate
    smbfs
    ssh
    ubuntu-base
    xfce4
    xfce4-goodies
    xfwm4
    xserver-xorg
    x-window-system-core
    You might want to use xubuntu-desktop instead of xfce4 and xfce4-goodies this will install a lot of other nice applications too. ("makes xfce4 an ubuntuish desktop")

    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.
    $ 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 :

    $ sudo debfoster -f

    from the manpage of debfoster :
    -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.
    After this your system is compatible with the keepers file.

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

    $ sudo init 2

    if xfce4 doesn't start do :

    $ startxfce4

    if it still doesn't start you should :

    backup your /etc/X11/xorg.conf by :
    suco cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

    reconfigure your xserver by :
    $ sudo dpkg-reconfigure xserver-xorg

    try to start xfce4 again by :

    $ startxfce4

    if it still doesn't start you should edit your xorg.conf by hand to solve the problem :
    $ 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 :

    $ sudo debfoster

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

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

    see here for how to configure prelink :
    http://www.ubuntuforums.org/showthre...hlight=prelink

    ================================================== ================================

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

    Install debfoster by :
    $ sudo apt-get install debfoster

    to build the keepers file without asking questions :

    $ sudo debfoster -q

    and edit your keepers file by :

    $ sudo pico /var/lib/debfoster/keepers

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

    Code:
    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.
    $ 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 :

    $ sudo debfoster -f

    from the manpage of debfoster :
    -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.
    After this your system is compatible with the keepers file.

    To start your gdm / gnome again do this :

    $ sudo init 2

    if gdm doesn't start do :

    $ startx

    if it still doesn't start you should :

    backup your /etc/X11/xorg.conf by :
    suco cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

    reconfigure your xserver by :
    $ sudo dpkg-reconfigure xserver-xorg

    try to start gdm/gnome again by :

    $ startx

    if it still doesn't start you should edit your xorg.conf by hand to solve the problem :
    $ 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 :

    $ sudo debfoster

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

    edit :
    here's the website of debfoster :

    http://www.fruit.je/debfoster

    here's a nice story about debfoster :

    http://ubuntu.wordpress.com/

    edit :
    -Made small modififications.
    -This thread applies for breezy as well.

    edit :
    -added further warning
    Last edited by ubuntu_demon; June 2nd, 2006 at 08:19 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •