Guide to Faster Ubuntu

Optimize ubuntu boot sequence by profiling it

  • While you are in grub menu highlight your preferred kernel version and press "e".
  • Highlight the line beginning with kernel and press "e" again. Press End key in order to goto end of that line.
  • Add a word "profile" without quotes to that line and press Enter.
  • Now press "b" to continue booting.

This one time special boot may take more time than ordinary boot. But during this boot ubuntu monitors file usage and preloads those files during subsequent boots.

prelink

Any executable that makes heavy use of shared libraries can benefit from prelinking. Prelinking resolves addresses of shared libraries in advance this reduces number of relocations.

Prelink is also useful in the context of security since we can tell prelink to make libraries load at random addresses until next run of prelink. This is useful since libraries won't load at fixed addresses on every system.

You can install prelink by issuing following command.

sudo apt-get -y install prelink

Change a line inside the configuration file /etc/default/prelink from

PRELINKING=unknown
to
PRELINKING=yes
We will do our first prelinking by executing following command
sudo /etc/cron.daily/prelink

Thats it you don't have to do anything else. Prelink daemon will run periodically to optimize your newly installed executables.

preload

Preload is a little application that monitors files of frequently used applications and and loads them in to the memory when system is idle. This usually results in lesser startup times for those applications. Install preload by executing following command.

sudo apt-get -y install preload

deborphan: Find orphan packages

After doing several installs and removes apt leaves lot of packages that are not needed anymore. You can find these packages using deborphan. Install deborphan by issuing following command.

sudo apt-get -y install deborphan

Now to see the list of packages which are not needed anymore just run following command.

deborphan

To remove these packages give following command.

sudo apt-get remove `deborphan`

To get full list of packages that are not essential for functioning of the system execute the following command.

deborphan --guess-all

This command will list data,dev and many other types packages that are not essential for system functioning. Please see man page of deborphan to find out more options.

localepurge

Remove locale information(language tables) of the applications that are not needed for you. localepurge maintains specified locales and removes the remaining. To install localepurge issue following command.

sudo apt-get -y install localepurge

During installation localepurge will ask you to select locales that you want to preserve. At this step select what you need and press OK. From now on localepurge will maintain only those locales which you selected during configuration step.

5 comments:

Willa said...

You write very well.

AlgoMantra said...

$sudo apt-get remove `deborphan`


THIS CMD REMOVES DEBORPHAN ITSELF.WTF!!

vamsee said...

Makes sense since no other package depends on deborphan.

Anonymous said...

Thanks for sharing this link, but unfortunately it seems to be down... Does anybody have a mirror or another source? Please answer to my post if you do!

I would appreciate if a staff member here at ubuntu-snippets.blogspot.com could post it.

Thanks,
Daniel

Anonymous said...

Hello there,

Thanks for sharing the link - but unfortunately it seems to be not working? Does anybody here at ubuntu-snippets.blogspot.com have a mirror or another source?


Thanks,
Mark