Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: HOWTO: using debfoster in practice

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

    HOWTO: using debfoster in practice

    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

    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 hoary or you have entered a dependencies hell on accident.

    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 : www.ubuntulinux.org/wiki/guidetohoary

    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
    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/
    Last edited by ubuntu_demon; October 10th, 2005 at 10:35 AM.

  2. #2
    Join Date
    Feb 2005
    Beans
    Hidden!

    Re: HOWTO: using debfoster in practice

    Thanks, I wanted to know how to use it. I still haven't tested it 'cause its impossible for a human to read that fast LOL, but ill tell you once I test it.
    Sylvia: Look at what you've done to him!
    Christof: I have given Truman the chance to lead a normal life. The world, the place you live in, is the sick place.

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

    Re: HOWTO: using debfoster in practice

    Quote Originally Posted by bored2k
    Thanks, I wanted to know how to use it. I still haven't tested it 'cause its impossible for a human to read that fast LOL, but ill tell you once I test it.
    okay

  4. #4
    Join Date
    Mar 2005
    Location
    Luxemburg
    Beans
    14

    Re: HOWTO: using debfoster in practice

    Thanks for this HOWTO, I like to keep my system clean

    Basically debfoster operates at the package level and I have now found a program, which finds cruft at the file level:

    cruft - Find any cruft built up on your system

    Has anyone exerience with this program? I have tried it out but don't know how to decide what to delete, don't wan't to break my system.

    Greetings,
    Daniel

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

    Re: HOWTO: using debfoster in practice

    Quote Originally Posted by underworld
    Thanks for this HOWTO, I like to keep my system clean

    Basically debfoster operates at the package level and I have now found a program, which finds cruft at the file level:

    cruft - Find any cruft built up on your system

    Has anyone exerience with this program? I have tried it out but don't know how to decide what to delete, don't wan't to break my system.

    Greetings,
    Daniel
    thnx for the tip! I didn't know cruft.

    http://packages.ubuntu.com/hoary/admin/cruft

    So it's still a pre-release. So you have to be really careful. Only remove stuff if you are absolutely sure.

    /usr/share/doc/cruft has a README and TODO file

    So here we go :

    $sudo pico /etc/cruft/explain/cruftexcludes

    and put some directories in that you don't want to be included in the cruft search for example like this :
    Code:
    #!/bin/bash
    find /home
    find /usr/java
    find /sys
    find /.dev
    find /var
    find /usr/share/fonts
    find /usr/share/icons
    $sudo chmod +x /etc/cruft/explain/cruftexcludes

    $sudo cruft

    add stuff into your cruftexcludes that you are sure you want to keep and do sudo cruft again. After a while you should find some files that can be removed but only if you are absolutely sure.

    I don't think you'll find much stuff that you can safely remove. So it isn't worth the hassle unless you are nerdish like me

    PS don't remove backups of configuration files. That won't safe much space and isn't worth it.
    Last edited by ubuntu_demon; April 8th, 2005 at 03:24 PM.

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

    Re: HOWTO: using debfoster in practice

    I've added xdiskusage to scenario 2 :

    xdiskusage is nice if you want to easily see where the space on your harddrive goes
    $ sudo apt-get install xdiskusage

    $ sudo xdiskusage

  7. #7
    Join Date
    Mar 2005
    Location
    Luxemburg
    Beans
    14

    Re: HOWTO: using debfoster in practice

    Quote Originally Posted by demon666_nl
    xdiskusage is nice if you want to easily see where the space on your harddrive goes
    Filelight is also quite nice, show the disk usage in concentric segmented-rings: filelight screenshoot.

    Greetings,
    Daniel

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

    Re: HOWTO: using debfoster in practice

    Quote Originally Posted by underworld
    Filelight is also quite nice, show the disk usage in concentric segmented-rings: filelight screenshoot.

    Greetings,
    Daniel
    thnx for the tip

    It looks really nice. It would be great if there was a gnome equivalent because it depends on kdelibraries (if I only need them for this app then it's a bit unnecessary) and I can't use it to map my remote filesystems (samba)

  9. #9
    Join Date
    Feb 2005
    Beans
    Hidden!

    Re: HOWTO: using debfoster in practice

    Hey demon666, as you know I went XFCE some minutes ago, and I'd like to cut off some of that GNOME fat, but, there are some gnome apps I still use like nautilus, anjuta, gaim, abiword and some more. Any pointers on how to -not- deleting something unwanted?
    Sylvia: Look at what you've done to him!
    Christof: I have given Truman the chance to lead a normal life. The world, the place you live in, is the sick place.

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

    Re: HOWTO: using debfoster in practice

    Quote Originally Posted by bored2k
    Hey demon666, as you know I went XFCE some minutes ago, and I'd like to cut off some of that GNOME fat, but, there are some gnome apps I still use like nautilus, anjuta, gaim, abiword and some more. Any pointers on how to -not- deleting something unwanted?
    scenario2 and don't remove the application you want from the keepers file if they are not mentioned because they are not orphaned just find out the packagename using apt-cache and add them to your keepers file. Remove all bloat you don't use from the keepers file

Page 1 of 2 12 LastLast

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
  •