1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

Tutorial Clean up and optimize ubuntu 12.10 quantal quetzal, ubuntu server and any version

Discussion in 'Linux Distributions' started by Draft, Apr 11, 2013.

  1. Draft

    Draft Administrator Staff Member Administrator

    For cleaning up Ubuntu 12.10 , you can use GUI applications like ubuntu tweak and/or bleachbit and with baobab to check disk space but I prefer to use the terminal.


    Here are the commands That I use to save space and clean up all ubuntu 12.10 versions ( Ubuntu, Lubuntu, Xubuntu … )


    Cleaning up Ubuntu using the terminal


    Let’s start by checking the occupation of disk space you can use the command


    df -a


    then check the size of the main folders
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Remove unnecessary libraries and packages:


    To delete all package dependencies removed
    Code:

       Sorry you need to Register / Login to see this Codes!    


    delete the files (.deb) of the packages that are no longer installed in the system;
    Code:

       Sorry you need to Register / Login to see this Codes!    


    The following command is really interesting, because it allows the removal even of the configuration files. This can be useful when you want to reinstall applications from scratch.
    Code:

       Sorry you need to Register / Login to see this Codes!    


    clean is much more radical than autoclean. It removes any files .deb from the apt cache, including those relating to the packages currently installed. This command allow a good a good recovery of disk space counterpart is that if you reinstall a package it have to be downloaded. (1.2 GB recovered)
    Code:

       Sorry you need to Register / Login to see this Codes!    


    ##r remove from the cache (/ var / cache / apt) any package, except for the lock files


    we can tie together the commands with:
    Code:

       Sorry you need to Register / Login to see this Codes!    


    ( I recovered 1.2 GB )


    Now, check and resolve any errors or broken dependencies with:
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Remove orphaned libraries
    Code:

       Sorry you need to Register / Login to see this Codes!    

    sudo apt-get remove --purge `deborphan`; sudo apt-get autoremove
    or
    sudo deborphan | xargs sudo apt-get -y remove --purge
    and[/code]


    To search and cleaning unused configurations


    To search and cleaning folders and unused configurations files we can use :
    Code:

       Sorry you need to Register / Login to see this Codes!    


    to seek only
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Remove Old Kernel


    Each version of the kernel can occupy up to 150 MB. If you have downloaded the headers you get 250MB of space. Therefore becomes crucial periodically remove some of the older kernels.


    Please or Register to view linksheck the current kernel t


    uname -r


    View the installed kernels


    Code:

       Sorry you need to Register / Login to see this Codes!    


    Code:

       Sorry you need to Register / Login to see this Codes!    


    Lists the headers installed
    Code:

       Sorry you need to Register / Login to see this Codes!    


    First remove the headers
    using somethings like this
    Code:

       Sorry you need to Register / Login to see this Codes!    


    then remove any specific kernel that is no longer needed
    Code:

       Sorry you need to Register / Login to see this Codes!    


    ( 0.6 GB recovered )


    Remove unnecessary location data packets


    To remove packages and languages ​​that do not involve using the program localpurge.
    Code:

       Sorry you need to Register / Login to see this Codes!    


    .
    In the window that appears after installation, select the languages ​​you wish to protect.
    Here you can select the languages ​​that interest us.
    for example we can check:
    en
    en_GB
    en_US
    en_GB.UTF-8
    en_US.UTF-8


    then
    Code:

       Sorry you need to Register / Login to see this Codes!    


    to reconfigure localpurge type
    Code:

       Sorry you need to Register / Login to see this Codes!    


    To save space: remove o shrink files


    Let’s start by checking the folders size into home directory.
    You can use the command


    home directory


    Let’s start by checking the folders size into home directory.
    You can use the command
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Files to check periodically to save space:


    .xession-errors


    One of the files that can grow up to tens of GB and that may need to check is the file:
    /home/<myhome>/.xsession-errors


    This file can be erased from time to time.


    or to reduce it and keep last 200 lines of messages
    Code:

       Sorry you need to Register / Login to see this Codes!    


    A home directory that you can grow a lot is the directory /cache.
    There there are the browsers cache so to clean up it I prefer to use browser commands.


    The directory /home/my-home/tmp should be checked and emptied every so often.


    directory /var


    at the root level, from time to time, check the /var direcotry :
    /var/log/
    /var/tmp/…
    /var/cache/…


    to display the size of the /var
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Alert. You should only delete files. Absolutely not delete the folders that contain them.


    Large size file


    May be useful to check if exist large size files everyware e for any users.
    The command for 750MB size files may be like:
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Services


    When you start ubuntu like any S.O. are activated services that are not always necessary with the inevitable resource consumption. To check the services that are not strictly necessary on a terminal you can use sysv-rc-conf.


    to install
    Code:

       Sorry you need to Register / Login to see this Codes!    


    to start with
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Check or uncheck the options to set the start whether or not a service in a given runlevel (Less services are running more resources are available).


    Free up RAM


    To release the RAM could be useful
    Code:

       Sorry you need to Register / Login to see this Codes!    


    more: Please or Register to view links


    Optimize Ubuntu


    Manage archives


    Install applications to manage archives of files compressed.
    If one needs to use the various formats of compressed files evaluate the installation of the following packages.
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Common Codecs


    A few common codecs
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Medibuntu


    Perhaps you have to evaluate installation of non-free-codec. “Medibuntu (Multimedia, Entertainment & Distractions In Ubuntu) is a repository of packages that cannot be included into the Ubuntu distribution for legal reasons (copyright, license, patent, etc). ” Please or Register to view links
    Code:

       Sorry you need to Register / Login to see this Codes!    


    w32codecs video codecs for popular proprietary formats not natively supported by mplayer Please or Register to view links


    libdvdcss2 for play encrypted DVD Please or Register to view links


    Ubuntu 32bit
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Ubuntu 64bit
    Code:

       Sorry you need to Register / Login to see this Codes!    


    FSlint


    FSlint is a useful application to search for duplicate files and not only in Ubuntu and Debian Linux ..
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Please or Register to view links


    GUI


    bleachbit is an effective way to clean a Linux system like Ubuntu: apt cache, browsers cache …


    install
    Code:

       Sorry you need to Register / Login to see this Codes!    


    be used as either a user as root


    Ubuntu-Tweak


    Ubuntu Tweak allows configuration via GUI Ubuntu easily. Cleaning the cache of web browsers … and the removal of obsolete kernel, Configuring themes, sounds, default applications …


    install :
    Code:

       Sorry you need to Register / Login to see this Codes!    


    Device busy


    In case of error device busy proceed similarly to what reported in this post Please or Register to view links


    List of useful applications


    Please or Register to view links


    Links: