View Full Version : Prelinking Guide- Make Ubuntu Feel Faster
poofyhairguy
October 11th, 2005, 09:58 AM
Disclaimer: Prelinking might break your system! Only consider for use if you can risk the chance that your install might mess up. Most of all make sure that it gets to run the whole thing through the first time you prelink. Stopping in the middle can lead to system failure. Prelinking is a powerful device and needs to be used with care.
Originally written by Jdong.
UPDATE 1/2/07: Prelink is no longer necessary in Feisty. Feisty uses a new linking mechanism called DT_GNU_HASH which dramatically speeds up the linking process without the need for continuously running this prelink program. Again, prelink is NOT useful starting from Feisty
Reason to use Prelinking
(from the Gentoo Linux Prelinking Guide)
Most common applications make use of shared libraries. These shared libraries need to be loaded into memory at runtime and the various symbol references need to be resolved. For most small programs this dynamic linking is very quick. But for programs written in C++ and that have many library dependencies, the dynamic linking can take a fair amount of time.
On most systems, libraries are not changed very often and when a program is run, the operations taken to link the program are the same every time. Prelink takes advantage of this by carrying out the linking and storing it in the executable, in effect prelinking it.
Prelinking can cut the startup times of applications. For example, a typical KDE program's loading time can be cut by as much as 50%. The only maintenance required is re-running prelink every time a library is upgraded for a pre-linked executable.
Yet there is a chance that prelinking might mess up something, so use at your own risk.
How to enable prelink
1. Activate Ubuntu universe sources
2. Put this command into terminal to install Prelink:
sudo apt-get install prelink
3. Now put this command into the terminal:
sudo gedit /etc/default/prelink
4. Change where it says "PRELINKING=unknown from unknown" to "yes"
5. Adjust the other options if you know what the heck you're doing. If it looks foreign to you, the defaults work well.
6. To start the first prelink (the longest one!), put this in terminal:
sudo /etc/cron.daily/prelink
Automatic Prelinking After Program Are Installed
One problem with prelinking in that when you install new programs those programs are not prelinked. So to avoid this problem when installing programs with apt-get or synaptic, use the directions below.
1. Put this in terminal:
sudo gedit /etc/apt/apt.conf
2. When the file opens in Gedit, put this line at the end of the file and save (even if the file has no content before you add the line):
DPkg::Post-Invoke {"echo Running prelink, please wait...;/etc/cron.daily/prelink";}
General Notes About Prelinking
In the future, prelink performs a quick prelink (a less-than-1-minute procedure on most systems) daily, usually at midnight. Every 14 days, or whatever you changed it to be, a full prelink will run.
If you just did a major apt-get upgrade that changed systemwide libraries (i.e. libc6, glibc, major gnome/X libs, etc etc etc) and experience cryptic errors about libs, rerun step 6.
To undo prelink, change step 4 from yes to no, then rerun step 6.
Prelinking will make the binaries it prelinks change, so it's not appropriate if you have tripwire or another checksum-based IDS system, or if you do incremental or differential backups to save on space.
mlomker
October 11th, 2005, 06:06 PM
sudo gedit /etc/apt/apt.conf
Thanks for the guide! I had installed prelinking but didn't know about the apt configuration.
Breezy amd64 does not appear to have an apt.conf file. I did, however, find a /etc/apt/apt.conf.d directory that has similar scripts. I created a new script called S99prelink and that appears to do the trick.
ubunxpm
October 13th, 2005, 03:32 PM
I have a question. Eventhough prelinking sonds like a miracle tweak that would speed up most applications; since you noted to use this prelinking at one's own risk, I was wondering if prelinking would affect the stability of the whole operating system negatively? I remember reading a similar thread for hoary but didn't perform the changes. I am asking this because if it can speed up the system why isn't the ubuntu gets installed prelinking enabled off the bat and I would prefer the stability of ubuntu over the performance under any condition. So please comment about this if you have experience from hoary or breezy's preview release. Thanks
mlomker
October 13th, 2005, 03:38 PM
So please comment about this if you have experience from hoary or breezy's preview release. Thanks
I ran prelinking on Hoary and now Breezy. To be honest, I haven't noticed any performance difference...other than the few seconds delay while waiting for the prelinking to finish when I install packages now. I certainly didn't run disk benchmarks before and after, but it doesn't seem like much to me.
ubunxpm
October 13th, 2005, 03:46 PM
Yet there is a chance that prelinking might mess up something, so use at your own risk.
Well, then it does not make a major difference in performance. Obviously a memory upgrade would do a whole lot more to the performance than prelinking. Did anything go wrong because of it where normally it wouldn't have?
poofyhairguy
October 13th, 2005, 05:52 PM
Well, then it does not make a major difference in performance. Obviously a memory upgrade would do a whole lot more to the performance than prelinking.
Yes. Prelinking can help decrease the start up times for some applications. Its not a miracle tweak that makes everything faster, its just a way to get some applications to load faster.
PsyberOneZero
October 13th, 2005, 10:34 PM
I started prelinking a few weeks ago in Breezy, the major differnece I felt was in opening OO.org apps for the first time, Writer went from ~10sec to 3-4sec, same for the rest OO.org, and Gimp.
Great tutorial poofyhairguy/jdong.
Kebabji
October 14th, 2005, 12:16 AM
i can def see a dif in oo.org yayy thanks for the great tutorial
Saiboogu
October 14th, 2005, 04:44 AM
Same here - improvement in apps like OOo and Gimp. That's enough for me - I don't need gaim to load faster, for example, because its already pretty quick - what makes this worthwhile is the savings on the larger apps. Great guide, thanks.
merlyn
October 16th, 2005, 08:39 AM
Thanks for the guide! I had installed prelinking but didn't know about the apt configuration.
Breezy amd64 does not appear to have an apt.conf file. I did, however, find a /etc/apt/apt.conf.d directory that has similar scripts. I created a new script called S99prelink and that appears to do the trick.
Could the steps you followed to do this be added to the original 'Howto'.
Cheers.
Leif
October 16th, 2005, 11:43 AM
I am asking this because if it can speed up the system why isn't the ubuntu gets installed prelinking enabled off the bat and I would prefer the stability of ubuntu over the performance under any condition.
I tried prelinking in hoary, on two different systems, and each time something went wrong. I was able to un-prelink, but I did have a couple of minutes where everything was very broken.
Chareos
October 16th, 2005, 03:02 PM
Right... what is something goes wrong ?
I mean... what happens if prelink brokes everything ?
And... is it possible undo to fail ?
Last question: is there a way to prelink (and keep prelinked) just a few applications ?
Let's say firefox, openoffice and some more ? (I know tehre was ooprelink, but what a about other apps ?)
steffen
October 22nd, 2005, 12:28 PM
Any way of prelinking openoffice.org2 only? That's the only app that takes ages to load, even with my tweaked memory settings in the prefs.
As far as I can see, the ooqstart only preloads ooo1, not 2
geearf
October 23rd, 2005, 01:47 AM
Prelinking my system breaks the postfix package, and then I have some messages like
ldconfig: /usr/lib/libpostfix-util.so.1 is not a symbolic link
ldconfig: /usr/lib/libpostfix-global.so.1 is not a symbolic link
Mizzou_Engineer
October 23rd, 2005, 03:35 AM
You should ask one of the devs at http://opensuse.org as they have prelinked only the KDE base, KDM, OOo, Mozilla, Firefox, and a couple other things in SuSE 10.0.
But, the prelinking added about 30-45 sec. to the startup and shutdown and for some reason, it didn't seem to do much. OOo 2.0 runs faster un-prelinked here in Ubuntu than it did with pre-linking in SuSE.
jeffreyvergara.NET
October 24th, 2005, 03:31 PM
installing and uninstalling programs seems to be slower than before, waiting for prelinking to finish tooks time to finish
zenrox
October 24th, 2005, 06:55 PM
installing and uninstalling programs seems to be slower than before, waiting for prelinking to finish tooks time to finish
Thats the only downside but if you use apt-get it is faster with prelink has something to do with the was the console is implembented in the dialouge some how
but its ok with me tho it still get the job done:D
tonderai
October 28th, 2005, 01:02 PM
So please comment about this if you have experience from hoary or breezy's preview release. Thanks
I found the hard disk 'grind' from prelink and the resulting slowdown pretty annoying (esp. on laptop), outweighing small loadup time improvements. Some instability too, but I can't tell if that's linked to prelink.
PS The best way to speed up OpenOffice is to use Abiword/Gnumeric instead ;)
Rxke
October 29th, 2005, 10:30 PM
Works great on an ancient Clamshell iBook! :D
Got a bit worried about the time it took for the initial prelink session, though, heehee. Took ages.
on a slower machine, the speedup is quite spectacular, thanks a lot!
geearf
October 30th, 2005, 03:03 PM
Prelinking my system breaks the postfix package, and then I have some messages like
ldconfig: /usr/lib/libpostfix-util.so.1 is not a symbolic link
ldconfig: /usr/lib/libpostfix-global.so.1 is not a symbolic link
I can get rid of these by reinstalling postfix, but another prelink make them come back
please any ideas ?
tonderai
October 30th, 2005, 05:30 PM
Prelinking my system breaks the postfix package, and then I have some messages like
ldconfig: /usr/lib/libpostfix-util.so.1 is not a symbolic link
ldconfig: /usr/lib/libpostfix-global.so.1 is not a symbolic link
I got this as well, but the only way I found to stop it was to stop prelinking and reinstall the postfix package.
geearf
October 30th, 2005, 08:05 PM
Well it actually does not bother me too much, but I'd still like to fix it, so one in a while I reinstall the package, and prelink will kill it later :cool:
CHUCKYCHUCK
November 1st, 2005, 02:45 AM
i have a question about undoing prelink, in the 1st post it's said that to undo prelink, i have to modify the option from "yes" to "no" in the /etc/default/prelink, and then execute /etc/cron ...
but i did some search, and i found that prelink can also be undone by the 'undo' option of prelink, ( prelink -u i remembered )
which method should i use ??
( i have no problems with prelink, just to know :) | except after the install of acroread, when prelinking took 45 minutes ............ for the others packages installations it just takes a few secondes but with acroread ... strange isn't it ?? )
thx
Sionide
November 1st, 2005, 07:15 PM
Seems to be working fine for me. :) Thanks for the Guide guys.
herot
November 1st, 2005, 08:44 PM
seems to be working but i dunno if it has sped things up too much more...
what sort of performance gain should i expect when using prelinking??
samwyse
November 2nd, 2005, 02:07 AM
Thanks, now I know why Fedora was much faster at starting X :)
Sionide
November 2nd, 2005, 03:16 AM
Prelinking after apt-get is taking ages - is it actually that essential seeing as the default config loads the prelink command at midnight every night??
xingmu
November 2nd, 2005, 07:16 AM
I love some of the HOWTO's that are on the forums. But this last one makes me think there needs to be a warning system for HOWTO's. Last night, just before sleeping, I saw this prelinking guide and decided to give it a try. Being tired and lazy, I did a very stupid thing. I was working off my laptop on battery-power. Even though I knew I didn't have much time left, I ran the last step in the guide: sudo /etc/cron.daily/prelink. In the middle of the process, my battery ran out and the laptop switched off. I just shrugged my shoulders and went to bed.
This morning I woke up to a very ugly sight. I booted up my computer and halfway through the boot-up started seeing numerous error messages:
/usr/bin/cut: cannot execute binary file
/bin/chmod: cannot execute binary file
....
Suffice to say, Ubuntu wasn't booting anymore. I booted up in recovery mode and thought maybe if I ran prelink again, it'd all be ok? No. When running prelink, it had errors that bascially said all of my libraries did not have a valid ELF header. I thought maybe I could just reinstall my binaries (and libraries?)...but of course apt-get wouldn't run either. So I decided to just give up and reinstall Breezy. Kinda sucked wasting my whole morning on that when I had more important things to do today.
I know that I was dumb for doing a serious operation on low battery power. BUT! To be honest, I didn't realize that prelink was such a powerful operation. I figured it was just like any other package and I could simply uninstall it if it messed up anything. Besides my concern that dumb people like me might not realize there is serious risks with prelink, I am wondering how you would undo everything if you just didn't like prelink's effects. Seems like the ideal HOWTO would tell you the risk level involved and "how to undo" as well.
poofyhairguy
November 2nd, 2005, 08:20 AM
I love some of the HOWTO's that are on the forums. But this last one makes me think there needs to be a warning system for HOWTO's. Last night, just before sleeping, I saw this prelinking guide and decided to give it a try. Being tired and lazy, I did a very stupid thing. I was working off my laptop on battery-power. Even though I knew I didn't have much time left, I ran the last step in the guide: sudo /etc/cron.daily/prelink. In the middle of the process, my battery ran out and the laptop switched off. I just shrugged my shoulders and went to bed.
This morning I woke up to a very ugly sight. I booted up my computer and halfway through the boot-up started seeing numerous error messages:
/usr/bin/cut: cannot execute binary file
/bin/chmod: cannot execute binary file
....
Suffice to say, Ubuntu wasn't booting anymore. I booted up in recovery mode and thought maybe if I ran prelink again, it'd all be ok? No. When running prelink, it had errors that bascially said all of my libraries did not have a valid ELF header. I thought maybe I could just reinstall my binaries (and libraries?)...but of course apt-get wouldn't run either. So I decided to just give up and reinstall Breezy. Kinda sucked wasting my whole morning on that when I had more important things to do today.
I know that I was dumb for doing a serious operation on low battery power. BUT! To be honest, I didn't realize that prelink was such a powerful operation. I figured it was just like any other package and I could simply uninstall it if it messed up anything. Besides my concern that dumb people like me might not realize there is serious risks with prelink, I am wondering how you would undo everything if you just didn't like prelink's effects. Seems like the ideal HOWTO would tell you the risk level involved and "how to undo" as well.
Sorry it messed up your system. Thanks for the suggestion, I juse added a disclaimer. I have never heard of such problems with it before and I promise if I knew that turning off you machine in the middle could mess up things I woulc have warned people.
samwyse
November 2nd, 2005, 02:39 PM
Prelinking after apt-get is taking ages - is it actually that essential seeing as the default config loads the prelink command at midnight every night??
I was wondering the same thing.
jeremy
November 2nd, 2005, 06:29 PM
Ubuntu is fast enough for me, but I did once speed up windows ME by doing a yoga course and slowing down my heartbeat!
xingmu
November 2nd, 2005, 07:11 PM
Sorry it messed up your system. Thanks for the suggestion, I juse added a disclaimer. I have never heard of such problems with it before and I promise if I knew that turning off you machine in the middle could mess up things I woulc have warned people.
Cool, I saw it first thing when I loaded up this thread. Thanks! " If just one more person can be saved...." :)
autocrosser
November 7th, 2005, 12:56 AM
Just tried to get prelink & apt reported--
dean@Dual1:~$ sudo apt-get install prelink
Reading package lists... Done
Building dependency tree... Done
Package prelink is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Anyone have any ideas??
geearf
November 7th, 2005, 05:07 PM
post your source.list please.
autocrosser
November 9th, 2005, 11:56 AM
sources.list---I'm running a PPC (Dual 1.25 Mirror-Door)
deb-src http://archive.ubuntu.com/ubuntu breezy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu breezy-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu breezy-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb-src http://archive.ubuntu.com/ubuntu breezy universe
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
## deb http://archive.ubuntu.com/ubuntu breezy-backports main restricted universe multiverse
## deb-src http://archive.ubuntu.com/ubuntu breezy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu breezy-security main restricted
deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted
deb http://security.ubuntu.com/ubuntu breezy-security universe
deb-src http://security.ubuntu.com/ubuntu breezy-security universe
deb http://archive.ubuntu.com/ubuntu/ breezy universe main restricted multiverse
deb http://antesis.freecontrib.org/mirrors/ubuntu/plf/ breezy free non-free
deb-src http://antesis.freecontrib.org/mirrors/ubuntu/plf/ breezy free non-free
Yagisan
November 9th, 2005, 12:50 PM
Prelinking after apt-get is taking ages - is it actually that essential seeing as the default config loads the prelink command at midnight every night??It is rather important, especially if you are upgrading core system files (you want to make sure the right files are being used). If you don't have anacron installed, the midnight prelink run never gets done, if you turn the pc off before midnight.
You must be running running apt-get a lot. If you are tracking say dapper, I probally would not be prelinking my system, I'd only do it on a relatively unchanging system.
geearf
November 9th, 2005, 03:21 PM
deb-src http://archive.ubuntu.com/ubuntu breezy universe
I don't get why you only have the deb-src here, try adding the deb too and see how it works
Sionide
November 9th, 2005, 04:17 PM
If you don't have anacron installed, the midnight prelink run never gets done, if you turn the pc off before midnight.
I don't usually turn my PC off at night - I'll google for anacron but how can I make sure that it is running every day at midnight??
You must be running running apt-get a lot.
Yeah, I tend to install new applications as I find out about them. It depends really.
autocrosser
November 9th, 2005, 09:40 PM
Re-tried apt-get after I posted--pulled it just fine--don't know why I had the prob the first time:???: --let prelink do it's thing & went to bed--all was good this morning:cool: ---I leave the system up 24/7, so I'll post any items of interest--most large apps load 5/15 sec faster:smile:
Thanks!!
I don't get why you only have the deb-src here, try adding the deb too and see how it works
trinaryouroboros
November 10th, 2005, 04:28 AM
poofyhairguy - you've made one Happy Dragon with this how-to!
Thank you!
:KS
Yagisan
November 10th, 2005, 05:07 AM
I don't usually turn my PC off at night - I'll google for anacron but how can I make sure that it is running every day at midnight?? If it isn't already installed
aptitude install anacron will install it. It basically makes sure that any jobs that were missed due to the system being off, are done shortly after the system being powered on.
Yeah, I tend to install new applications as I find out about them. It depends really. Perhaps it would be better to disable prelink until you have a relatively unchanging system. Although on my system it only takes 1m 5s to run (it takes longer to run apt-get update on my system, 2m 14s)
ace2005
November 20th, 2005, 04:45 PM
Um.. I only see
ace@Linux:~$ sudo /etc/cron.daily/prelink
In konsole when i ran it, do i have to keep waiting until it says something like finished, its been like 5mins and there is little disk activity
Should i have done this from the command line with the X server off?
What about the xcomposite manager, do i have to turn off the transparency and fade ins and shadows off too??
and do i have to close all the programs and stuff like Opera, Juk Superkaramba, Firestarter, and Azureus???
bugmenot
November 28th, 2005, 11:33 AM
Right... what is something goes wrong ?
Last question: is there a way to prelink (and keep prelinked) just a few applications ?
Let's say firefox, openoffice and some more ? (I know tehre was ooprelink, but what a about other apps ?)
I also want to prelink firefox and openoffice, but not the whole system.
Does somebody know how to do that?
ace2005
November 28th, 2005, 07:40 PM
Um.. I only see
In konsole when i ran it, do i have to keep waiting until it says something like finished, its been like 5mins and there is little disk activity
Should i have done this from the command line with the X server off?
What about the xcomposite manager, do i have to turn off the transparency and fade ins and shadows off too??
and do i have to close all the programs and stuff like Opera, Juk Superkaramba, Firestarter, and Azureus???
It took a while but it did finish but there was no output, does this mean it worked?
GoldBuggie
November 29th, 2005, 02:45 AM
ace2005: Yes it means it worked!
HowTo prelink only firefox(have not tested it but this should work in theory)
The file that tells which directories that should be processed by prelink is the following:
sudo kate /etc/prelink.conf
Comment out the lines starting with -l by putting a # in front of that line. This way you can easily return to your previous state.
I've checked which files and directories firefox uses on my system(kubuntu 5.10 kde3.5) and having prelink traverse throu these directories should be sufficiant. So add the following to the above stated .conf file:
-l /usr/lib/mozilla-firefox
-l /usr/lib/gtk-2.0 Now there are more files that my firefox use (/usr/lib/libcairo.so.2.2.3, /lib/tls/i686/cmov/libnss_nis-2.3.5.so ...) but since I'm not sure which files that comes with your system I will not attempt to mention them here. Instead I think the 2 above directories should be the most imprtant ones.
If anyone knows of any important file that I should include that everyone uses then please let me know.
Sionide
November 30th, 2005, 04:08 AM
It took a while but it did finish but there was no output, does this mean it worked?
Yep. No output is given. The first one will take the longest...
poofyhairguy
November 30th, 2005, 06:08 AM
ace2005: Yes it means it worked!
HowTo prelink only firefox(have not tested it but this should work in theory)
The file that tells which directories that should be processed by prelink is the following:
sudo kate /etc/prelink.conf
Comment out the lines starting with -l by putting a # in front of that line. This way you can easily return to your previous state.
I've checked which files and directories firefox uses on my system(kubuntu 5.10 kde3.5) and having prelink traverse throu these directories should be sufficiant. So add the following to the above stated .conf file:
-l /usr/lib/mozilla-firefox
-l /usr/lib/gtk-2.0 Now there are more files that my firefox use (/usr/lib/libcairo.so.2.2.3, /lib/tls/i686/cmov/libnss_nis-2.3.5.so ...) but since I'm not sure which files that comes with your system I will not attempt to mention them here. Instead I think the 2 above directories should be the most imprtant ones.
If anyone knows of any important file that I should include that everyone uses then please let me know.
Sweet. Does this work?
GoldBuggie
November 30th, 2005, 06:39 AM
actually only the only library you need to use is probably /usr/lib/mozilla-firefox but the gtk library has /usr/lib/gtk-2.0/2.4.0/engines/libclearlooks.so which is what firefox uses so I included it.
I'm going to run some tests this weekend with some different configs and a few more apps I'll return with the result as soon as I've done it. After that I can for sure tell you if more is needed.
Nutterpc
November 30th, 2005, 05:51 PM
Can I also suggest setting prelink to use -amR
used it in my gentoo days, worked then, and it works now :)
Nice guide too, systems working well now
EDIT: Testing out prelink using -amR on Ubuntu.....will post back once I know how it goes
GoldBuggie
December 1st, 2005, 02:02 AM
Ok tested with prelinking only firefox. Did some time testing as well. I will not post them since they will not show any improvement or chang on my system. Regardless of no prelinkning, full prelinking or only firefox. Maybe a test of seeing how the modules got loaded would be a better way but it would have taken more time for me :)
Anyway...I wanted to prelink firefox only(reduxing startup time at best). So prelinking is the way to go.
I first tried doing it the following way.
sudo prelink -vm /usr/lib/mozilla-firefox/firefox-bin
I got some trouble with not finding dependencies etc..so I tried doing a "-l /usr/lib/mozilla-firefox/firefox-bin" in prelink.conf but that didn't work as well. It seems prelink is bad at finding the dependencies so I have to manually add them.
On a i686 kernel(which is what I use) you will get 39 dependencies from firefox. For a i386 you will probably get 37 or 38. i686 brings a dependency on linux-gate.so.1 which is a file that does not exist(only in memory somewhere, look it up for more detail). So prelinking firefox means prelinking the remaining 38 files and its possible dependencies. Here is what you should put in your /etc/prelink.conf
####Firefox
-l /usr/lib/libz.so.1.2.3
-l /usr/lib/libfontconfig.so.1.0.4
-l /usr/lib/libgmodule-2.0.so.0.800.3
-l /usr/lib/libpango-1.0.so.0.1001.0
-l /usr/lib/libplc4.so
-l /usr/lib/libpangoft2-1.0.so.0.1001.0
-l /usr/lib/libnspr4.so
-l /usr/lib/libfreetype.so.6.3.5
-l /usr/lib/libplds4.so
-l /usr/lib/libgobject-2.0.so.0.800.3
-l /lib/ld-2.3.5.so
-l /usr/lib/libglib-2.0.so.0.800.3
-l /usr/lib/libexpat.so.1.0.0
-h /lib/tls/
-l /usr/lib/mozilla-firefox/libmozjs.so
-l /lib/libgcc_s.so.1
-l /usr/lib/libstdc++.so.6
-l /usr/lib/mozilla-firefox/libxpcom.so
-l /usr/lib/libatk-1.0.so.0
-l /usr/lib/libXfixes.so.3
-l /usr/lib/libXcursor.so.1
-l /usr/lib/libXrandr.so.2
-l /usr/lib/libXi.so.6
-l /usr/lib/libXext.so.6
-l /usr/lib/libXinerama.so.1
-l /usr/lib/libpng12.so.0
-l /usr/lib/libXdmcp.so.6
-l /usr/lib/libXau.so.6
-l /usr/lib/libX11.so.6
-l /usr/lib/libXrender.so.1
-l /usr/lib/libcairo.so.2
-l /usr/lib/libpangocairo-1.0.so.0
-l /usr/lib/libgdk-x11-2.0.so.0
-l /usr/lib/libgdk_pixbuf-2.0.so.0
-l /usr/lib/libgtk-x11-2.0.so.0
-l /usr/lib/libpango-1.0.so.0
-l /usr/lib/mozilla-firefox/firefox-bin
####Firefox
I was planning on trying some other software but at the moment it will not bring me anything since I will use the full prelink at this moment. Maybe in the future if there is some overwhelming demand on some software.
I went back to using the whole prelink since I felt my system wasn't as responsive as before(no scientific measurement only a feeling after have run prelink for quite a while) and I didn't want to go thrue which libraries would be best for kde.
Nutterpc
December 3rd, 2005, 05:19 AM
Well I can say that yes, by setting prelinking to -amR, does seem to take a little while for the system to adjust at first, but it does seem far more happy, the systems nice & snappy, unlike when you install stuff on ******* :P
It works for me, works well, but YMMV
Rob2687
December 3rd, 2005, 05:46 PM
I think -a broke something on my laptop. The updatenotifier process is now always at 60-70% CPU. I left it over night and it's still doing something.
Nutterpc
December 6th, 2005, 01:43 PM
That does seem a bit odd
Even on my machine (Duron 1Ghz, 768Mb RAM, 80Gb HDD) it took a while when I added -a to the prelink config file
Try taking it out again, or ctrl + c it
viscount
December 15th, 2005, 12:55 AM
Questions & more Questions
Does prelink automatically apply to every directory on the entire system?
I have several large exec fiels in my home folder that I would like prelinked
if they are not already being automatically prelinked.
Is it possible to manually prelink a single binary?
Is it possible to exclude certain programs that are known to be flakey with prelink?
poofyhairguy
December 15th, 2005, 01:15 AM
Questions & more Questions
Does prelink automatically apply to every directory on the entire system?
I have several large exec fiels in my home folder that I would like prelinked
if they are not already being automatically prelinked.
Is it possible to manually prelink a single binary?
Is it possible to exclude certain programs that are known to be flakey with prelink?
Ok, I know I made the guide but I really don't know details. I just converted a guide Jdong made for Warty.
Here is a page with WAY more details on prelink:
http://www.gentoo.org/doc/en/prelink-howto.xml
GoldBuggie
December 15th, 2005, 04:19 AM
Viscount
All of the questions is answered yes. You have to edit the /etc/prelink.conf file.
You will also see what is beeing prelinked and not. Basically it is like this.
-l <DIRECTORY or FILE>
Will prelink that directory(and its subdirs) or given file.
-b <DIRECTORY or FILE or *.FILETYPE>
Will make prelink NOT include the dir. or file.
Problem with prelinking a single binary is that all its dependencies needs to be prelinked as well. So just pointing to a executable will in many cases not work since it will probably complain about not beeing able to find the dependency.
Like what I tried to do with firefox before. Just prelinking the binary doesn't work you must prelink all the files that the binary uses and depends upon.
DiskMan
January 27th, 2006, 12:59 AM
I noticed that little fact myself when I did some tests using prelink, and didn't really notice any kind of 'real' speed boost other than my imagination. When I checked the prelink.cache, thats when I noticed that out of THOUSANDS of files [binary/lib] only a handful had actually been linked. Those that were linked, were small programs that didn't require much in order to run. Others such as Gnome/KDE/Xfce/etc were 'on their own' so to speak.
I wonder how many people actual notice that prelink does little or nothing on most machines out there. The main libs that I have on the 'blacklist' are standard GLIBC libraries, that if prelinked, would kill my box [trust me, I've tried it]. Most notable are libc.so and ld.so.
For most people, prelink is largely useless and does little, the rest is simply their imagination. Try running 'prelink -p', cache dump, it will show you whats being prelinked and whats not... the NOT part is going to be pretty large btw. DiskMan
dcast
January 27th, 2006, 03:24 AM
seems to work, thanks
sailor420
March 23rd, 2006, 09:40 PM
FYI, you may find, as I did, that if you install this on a laptop or other machine that doesn't stay on that often, the resulting slowdown from the backed up cronjob running when the machine is turned on may not be worth the miniscule speed boost that prelinking provides.
MichaelZ
May 1st, 2006, 04:11 AM
Automatic Prelinking After Program Are Installed
One problem with prelinking in that when you install new programs those programs are not prelinked. So to avoid this problem when installing programs with apt-get or synaptic, use the directions below.
[...]
Hello,
I have a question. In my system I do not have /etc/apt/apt.conf, but I have a directory /etc/apt/apt.conf.d
Inside I have 5 files: 05aptitude, 10periodic, 20archive,70debconf and 99update-notifier.
To which file should I added:
DPkg::Post-Invoke {"echo Running prelink, please wait...;/etc/cron.daily/prelink";}
Thank you very much.
Best wishes,
Michael
dresnu
May 20th, 2006, 10:46 AM
In my system I do not have /etc/apt/apt.conf
Just create that file by typing "sudo gedit /etc/apt/apt.conf" in the console, add that line inside and save the file.
MichaelZ
May 20th, 2006, 10:49 PM
Just create that file by typing "sudo gedit /etc/apt/apt.conf" in the console, add that line inside and save the file.
Hello,
Thank you very much for the help :).
Best wishes,
Michael
ozorba
June 2nd, 2006, 12:58 PM
I have experimented with prelinking. However I am running out of space and therefore want to revert back.
How do I do that?
Thanks,
OZ
dresnu
June 2nd, 2006, 03:25 PM
I have experimented with prelinking. However I am running out of space and therefore want to revert back.
Check the last line of the first post in this thread. Also delete the line "DPkg::Post-Invoke {"echo Running prelink, please wait...;/etc/cron.daily/prelink";}" if you had inserted it in /etc/apt/apt.conf.
roostishaw
June 8th, 2006, 12:14 AM
After I do sudo /etc/cron.daily/prelink it just keeps printing a y
Is it supposed to do this?
dresnu
June 8th, 2006, 10:43 AM
Could you please copy/paste a line of example so I can understand what you 're talking about.
lyricmuse
July 1st, 2006, 03:14 AM
Just did a fresh install of Dapper and prelinking. I've noticed an excellent improvement in load times. My sys specs are
2.4 ghz celeron (MSI socket 478)
768 ddr
200 gb hard drive
geforce 4 mx440 video
creative live 5.1
I have wanted to try prelinking in the past but was afraid it would break my system. I'm playing around with ubuntu so I thought I would give it a shot. Thanks for the great tip.=D>
ubuntu_demon
July 14th, 2006, 06:33 PM
I created a blog entry about Desktop performance tweaks and linked to this thread :
http://ubuntudemon.wordpress.com/2006/07/14/desktop-performance-tweaks/
To digg it :
http://digg.com/linux_unix/Ubuntu_Desktop_performance_tweaks
yaztromo
July 25th, 2006, 08:04 PM
I just installed prelinking for the guide then did a prelink -p to see what was being prelinked and what wasn't. Firefox is was the program I wanted prelinking most for.
But i see this
/usr/lib/firefox/firefox (not prelinkable)
Pretty pointless if this is the case :-| .
I really think prelinking is a waste of time. For a start firefox doesn't get prelinked at all and the only 2 applications that start slightly faster are GIMP and OO.
GoldBuggie
July 25th, 2006, 08:14 PM
But i see this
Quote:
/usr/lib/firefox/firefox (not prelinkable)
Pretty pointless if this is the case .
I really think prelinking is a waste of time. For a start firefox doesn't get prelinked at all and the only 2 applications that start slightly faster are GIMP and OO.
Look att the files that firefox needs prelinked instead. If I remember correctly there was one or two "null files". Don't remember what the files was called exactly but there are two modules that firefox gets for dependency that are virtual files and thus aren't really files. So when prelink says that firefox isn't prelink it just means that those two files aren't prelink, but the actual files are. So in practice firefox is prelink. Just ignore that message.
If the prelinking makes startup faster or not I leave to the subjective user.
yaztromo
July 25th, 2006, 09:02 PM
I just installed prelinking then did a prelink -p to see what was being prelinked and what wasn't. Firefox was the program I wanted prelinking most.
But i see this
/usr/lib/firefox/firefox (not prelinkable)
Pretty pointless if this is the case :-| .
I really think prelinking is a waste of time. For a start firefox doesn't get prelinked at all and the only 2 applications that start slightly faster are GIMP and OO.
H Roark
August 2nd, 2006, 05:11 AM
Anyone see this before?
*** glibc detected *** free(): invalid pointer: 0xb7e2ec38 ***
/etc/cron.daily/prelink: line 53: 27838 Aborted
/usr/sbin/prelink -a $PRELINK_OPTS >>/var/log/prelink.log 2>&1
Maybe it's just me. A check of the log file it spits out reveals this in the last 2 lines...
/usr/sbin/prelink.bin: /usr/bin/mppdec: Symbol section index outside of section numbers
Prelink failed with return value 134
mppdec is used for playing music from the cmd line? never used it. I don't think sound converter or any of my audio programs need it, so if you have a tip on how to remove it; great.
Any other thoughts would be appreciated.
Thanks in advance,
Roark
PS - followed first post to a T. Issued this: sudo /etc/cron.daily/prelink and got the above results. Attached log file if that helps.
robert114
August 5th, 2006, 07:43 AM
I had this problem as well.
I've seem to fixed it for my machine by just completely removing the prelink program (including conf. files) and than just reinstalling it!
Right now my machine is prelinking and this seems to have solved my PC.
I don't know what has caused this problem! but for your info
I'm using the portback and a lot of other repo's maybe this causes my problem!
H Roark
August 6th, 2006, 06:45 PM
Thanks Robert, I tried that but still doesn't work. Fails at the same part. I'm thinking I may have a memory issue at that address...
Anyway, thanks for the suggestion. Hope it helps someone else if they have similar issues.
robert114
August 7th, 2006, 07:11 AM
To bad, did you purge the program?
Maybe it helps if you un-prelink your machine first and then remove (purge) the program and then re-install it.
But i'm not very familiar with prelinking so it might cause other problems, be carefull!!!
H Roark
August 7th, 2006, 09:42 PM
Robert,
I did the prelink undo command and then uninstalled the program. Tried re-installing it. Nothing. Same error.
So I'm thinking it's a hardware issue. Thanks again.
robert114
August 8th, 2006, 10:51 AM
Damn, to bad! :sad: I don't know anything else to look at!
mrvw0169
August 11th, 2006, 03:57 AM
Uh oh, I have a similar problem - except I ran my HD space to 0B free while downloading too many torrents at once and didn't pay attention during a prelink... So then prelink stopped/froze (left on for over an hour - usually takes 1 min) and won't continue even after freeing up space on / ...
So now I can't boot into the system (fsck segfaults) but I can boot into Recovery mode and luckily still be able to aptitude packages (but other commands won't work - they segfault too)... I've tried running prelink again (which works until the last line in the script where it uses awk but I think it's not needed anyway for prelink to work) both with turning prelink "yes" and "no" but my system is still broken...
I'll try to reinstall e2fsprogs once I get back to fix the fsck once I'm at my computer and maybe that works... But just wondering if there a quick way to do something like sudo aptitude reinstall base/* to get all the base packages reinstalled? Or another way to work around this without reinstalling Ubuntu (won't have time this whole week)?
xyz
October 16th, 2006, 04:41 PM
Works like a charm here! Thank you poofyhairguy's Avatar
poofyhairguy!
I always get this:
Running prelink, please wait...
/etc/default/prelink: line 41: syntax error near unexpected token `}'
/etc/default/prelink: line 41: `DPkg::Post-Invoke {"echo Running prelink, please wait...;/etc/cron.daily/prelink";}'
Is it normal? Should I remove all "unexpected tokens "}" on line 41"?
Thanks for reading.
John Nilsson
October 17th, 2006, 05:39 PM
It seems you've put the 'Dpkg::Post-invoke...' line in the wrong file. It should be in /etc/apt/apt.conf not in /etc/default/prelink.
xyz
October 18th, 2006, 10:37 AM
It seems you've put the 'Dpkg::Post-invoke...' line in the wrong file. It should be in /etc/apt/apt.conf not in /etc/default/prelink.
Thanks for this, John.
For some odd reason I had the 'Dpkg::Post-invoke...' line in both /etc/apt/apt.conf AND /etc/default/prelink files.
I've changed that and see what happens next time.
Good day!
xyz
October 20th, 2006, 04:01 PM
It seems you've put the 'Dpkg::Post-invoke...' line in the wrong file. It should be in /etc/apt/apt.conf not in /etc/default/prelink.
Thanks again John. I can now confirm that that was my problem.
Owdy
November 15th, 2006, 01:23 AM
I used this tutorial to prelink http://kudos.berlios.de/kf/kisimlar/tipsntrix.html#prelink
Is uninstalling same way as in this tutorial? There are that extra '
sudo prelink -avmR' command.
kebajonathan
December 8th, 2006, 11:01 PM
I'm just setting up a pc for my sister and using prelink with kde. I remenber that in gentoo, you had to tell KDE that it was prelinked by setting an option like KDE_IS_PRELINKED="true" in some file. Anyway, that file doesn't exist in Kubuntu so what I want to know is how to tell KDE it is prelinked and whether I need to... Do you know? THX for answers
ciscosurfer
December 8th, 2006, 11:10 PM
@poofyhairguy,
How effective is prelinking on an Edgy system?
&wi*m#~10+q
February 17th, 2007, 08:58 PM
thanx :)
bks
March 17th, 2007, 03:08 PM
This is perfect! I've been fighting with Wine and my latest error is a missing prelink. I will try this and hopefully it will work or at least I'll move on to the next error ](*,)
98xj
April 19th, 2007, 07:40 PM
just tried prelink with fawn, seems /etc/apt/apt.conf is now a apt.conf.d I put the prelink command into the 70debconf and don't see it run (I can run it from the shell) suggestions ?
llarmakarma
May 5th, 2007, 04:23 PM
Hi,
Thanks for the howto.
I am not too sure about the line about prelink not being useful on Feisty any more.
I still found a slight speedup running it o Feisty fawn.
Although, i did findit less of an improvement than when I ran prelink on breezy/edgy.
A google found the following information on the subject..
http://dev.laptop.org/ticket/639
"I'm fairly sure that people are slightly wrong about Ubuntu Feisty.
Ubuntu Feisty is now using DT_GNU_HASH. Fedora Core 6 was the first to use this. It makes run-time linking go faster for apps that use long and highly redundant symbol names. C++ apps are often this way,
...
Prelink thus makes much less of a difference. Run-time linking still isn't free though. The time has not been driven to zero, so prelink can still be useful. "
Regards
robert114
May 6th, 2007, 08:02 PM
Kebajonathan,
I've googled for the KDE_IS_PRELINKED="true" the only result that I found was in german (not my native language!) But from that forum post I assumed that you just have to enter the command as root in a terminal. I tried it here and didn't receive any error back!
So I think you don't have to edit a config file but you'll just have to enter the "KDE_IS_PRELINKED="true" command.
Correct me if I'm wrong!
Robert
factotum218
May 7th, 2007, 01:47 AM
great post didnt do much for my system in the gnome environment. after going back to xfce or openbox i did notice a bit of a difference.
I guess those days of eyeing up slackware for my box is coming.
nowshining
December 24th, 2007, 12:31 PM
i'm using gutsy and just openend up gimp and doing it (found it off another site - about prelinking and tried it out) it started up super-fast :P no i don't have compiz on, i recommended this on P4 systems at least as it does help make things in Gutsy much faster..
cooldudevamsee
July 22nd, 2008, 10:27 AM
Thanks for the guide.
HellionDarkLord
January 12th, 2010, 08:19 PM
I found this very interesting. so I tried it on my desktop with great results. Just now I treid it with my laptop and the touchpad didn't like it at all. So, I decided that I would
sudo apt-get remove prelink
then I decided that I would run auto clean and auto remove just to make sure that nothing was getting messed up with old packages and kernels.
That didn't work so well, so I commented out the option line that has the -mR options in it and it works beautifully.
thanks for the tip!!
About the prelink erroring after the laptop shut down while it was working this seems like a normal result to me. Shutting a system down in the middle of any kind of update will cause the same kind of problems.
nxsty
October 14th, 2010, 10:54 AM
Thanks for the guide!
I just wanted to add that this:
UPDATE 1/2/07: Prelink is no longer necessary in Feisty. Feisty uses a new linking mechanism called DT_GNU_HASH which dramatically speeds up the linking process without the need for continuously running this prelink program. Again, prelink is NOT useful starting from Feisty
.. is incorrect.
GNU hash is unrelated to what prelink does and you can still run prelink on a modern linux system, allthough the performance gain is not as good as it used to be with the old SysV hash.
3ntolo
April 8th, 2011, 04:30 PM
Thanks for the guide!
I tried it and I noticed a sensible improvement on my netbook (Ubuntu 10.10)
Thanks again
Powered by vBulletin® Version 4.2.2 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.