Few good Cleaning tips for Ubuntu

Discussion in 'Software' started by MoPaR, Sep 1, 2009.

  1. MoPaR

    MoPaR Private First Class

    Again, I'm not the writer, just the messenger :)

    If you want to clean your ubuntu machine you need to follow these simple steps to remove all unnecessary junk files.

    --------------------------------
    Remove Residual Config packages
    --------------------------------

    In Synaptic Package Manger, there is a built-in feature that gets rid of old Residual Config packages. Residual Config packages are usually dependency packages that are left behind after you uninstall a package from your machine. To use this feature, go to System > Administration > Synaptic Package Manager. On the bottom left hand corner of the window,click the Status button. In the list above the Sections, Status, Search, and Custom buttons, you should see the following text

    Installed
    Installed(auto removable)
    Installed(local or obsolete)
    Installed(upgradable)
    Not installed
    Not Installed (Residual config)

    Click on the “Residual config” text. (If the “Residual config dialogue does not appear, that means you do not have any Residual Config packages on your machine.

    If you want to remove you need to select those packages and click on apply from menu bar Remove packages are in progress.

    -----------------------
    Remove partial packages
    -----------------------

    This is yet another built-in feature, but this time it is not used in Synaptic Package Manager. It is used in theTerminal. To access the Terminal, go to Applications > Accessories > Terminal. Now, in the Terminal, key in the following command

    sudo apt-get autoclean

    ------------------------------
    Remove unnecessary locale data
    ------------------------------
    For this we need to install localepurge.Automagically remove unnecessary locale data.This is just a simple script to recover diskspace wasted for unneeded locale files and localized man pages. It will automagically be invoked upon completion of any apt installation run.

    Install localepurge in Ubuntu

    sudo apt-get install localepurge

    After installing anything with apt-get install, localepurge will remove all translation files and translated man pages in languages you cannot read.

    If you want to configure localepurge you need to edit /etc/locale.nopurge

    This can save you several megabytes of disk space, depending on the packages you have installed.

    Example:-

    I am trying to install dicus using apt-get

    sudo apt-get install discus

    after end of this installation you can see something like below

    localepurge: Disk space freed in /usr/share/locale: 41860K

    ------------------------------------------
    Remove “orphaned” packages Using GtkOrphan
    ------------------------------------------
    GtkOrphan (a Perl/Gtk2 application for debian systems) is a graphical tool which analyzes the status of your installations, looking for orphaned libraries. It implements a GUI front-end for deborphan, adding the package-removal capability.

    Install GtkOrphan in Ubuntu

    First you need to download latest version of GtkOrphan from here using the following command

    wget http://ftp.debian.org/debian/pool/main/g/gtkorphan/gtkorphan_0.4.2-2_all.deb

    Now you have gtkorphan_0.4.2-2_all.deb package you need to install this using the following command

    dpkg -i gtkorphan_0.4.2-2_all.deb

    At the time of installation you get the following error

    dpkg -i gtkorphan_0.4.2-2_all.deb
    Selecting previously deselected package gtkorphan.
    (Reading database … 175891 files and directories currently installed.)
    Unpacking gtkorphan (from gtkorphan_0.4.2-2_all.deb) …
    dpkg: dependency problems prevent configuration of gtkorphan:
    gtkorphan depends on deborphan (>= 1.7.17); however:
    Package deborphan is not installed.
    gtkorphan depends on libgtk2-gladexml-perl; however:
    Package libgtk2-gladexml-perl is not installed.
    dpkg: error processing gtkorphan (–install):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    gtkorphan

    You need to use the following command to fix

    sudo apt-get -f install

    This will complete the installation.Once you finished the installation go to System—>Administration—>Remove Orphaned Packages

    How to use GtkOrphan

    Use of GtkOrphan is intuitive and reflects use of deborphan. The screenshots will show you a full example. GtkOrphan must be run with root privilegies.

    At GtkOrphan's first run, you should initialize your system in order to keep track of needed packages, even if they are reported as orphaned.
    In the main window, expand the "Options" section and check the "Show all orphan packages, not only those in the libs section" checkbox. Note: with this option, GtkOrphan will report as "orphaned" all those installed packages that are not dependencies for any other. In this way, for instance, packages such as gparted, ubuntu-desktop, wine will be listed too, as they are "top-level" packages and no other package depends on them. Now you can traverse this list and right-click->hibernate each package you want to keep and that you don't want to be reported as orphaned anymore. The hibernation list will keep these files and will not show them anymore. You can access and modify the hibernation list as you want, from the View menu or from the right-click popup menu.

    -----------------------------------------------
    How to clean /tmp/ folder contents on shutdown
    -----------------------------------------------
    sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
    gksudo gedit /etc/init.d/sysklogd

    * Find this section

    ...
    stop)
    log_begin_msg "Stopping system log daemon..."
    start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile
    log_end_msg $?
    ...

    * Add the following line below it

    rm -fr /tmp/* /tmp/.??*

    * Save the edited file

    A personal favourite of mine is Bleachbit.

    BleachBit deletes unnecessary files to free valuable disk space, maintain privacy, and remove junk. Rid your system of old clutter including cache, temporary files, cookies, and broken shortcuts. Designed for Linux systems, it wipes clean Bash, Beagle, Epiphany, Firefox, Flash, Java, KDE, OpenOffice.org, Opera, RealPlayer, rpmbuild, VIM, XChat, and more.

    More info and tut here: http://www.ubuntugeek.com/bleachbit...-to-free-disk-space-and-maintain-privacy.html
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds