Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I did a dumb thing and accidentally overwrote my copy of /usr/bin/sqlite3 on my Mac OS X 10.5.8. I don't have a Time Machine backup so I can't grab the file from there. When I try to run Apache2, I'm getting the error:

dyld: Library not loaded: /usr/lib/libsqlite3.0.dylib
  Referenced from: /usr/sbin/httpd
  Reason: no suitable image found.  Did find:
/usr/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
/usr/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
/usr/lib/libsqlite3.0.dylib: mach-o, but wrong architecture

How can I retrieve or rebuild /usr/bin/sqlite3?

Edit: Before all of this, I ran the 10.5.8 Combo Update in case something on my system was corrupted.

share|improve this question

migrated from stackoverflow.com Aug 19 '11 at 16:33

This question came from our site for professional and enthusiast programmers.

    
have you tried running the 10.5.8 Combo Update? It should reinstall it (at least if it has been updated between 10.5.0 to 10.5.8) –  Luke Morgan Aug 19 '11 at 7:07
    
Will this work, even though I'm already running at 10.5.8? –  Robert Martin Aug 19 '11 at 7:08
    
It is used if the installation is damaged, even if the requirement is between 10.5.0 and 10.5.7 I heard many people who used it on the same system version so it should work fine –  Luke Morgan Aug 19 '11 at 7:13
    
For posterity: This solution worked for me! –  Robert Martin Aug 19 '11 at 7:57
    
I'll post it as an answer, then –  Luke Morgan Aug 19 '11 at 8:08
add comment

3 Answers

up vote 1 down vote accepted

Reinstalling the entire Mac OS X is the guaranteed way to ensure all system components are correctly installed.

Sometimes you can get away with running a Combo Updater (the 10.5.8 in your case), it can repair a slightly damaged (or corrupted) installation.

If you are unsure of why things are missing or damaged, better to reinstall or at least run a Repair Permissions in Disk Utility. System files should be protected from deleting and you don't know if other protections are missing or changed.

share|improve this answer
    
Just to be clear, the combo updater only repairs missing things if that specific thing has changed. In practice, each successive update changes more and more, but it's not as good as reinstalling the OS and then patching things. It's s nice trick when it works, but it's by luck and not by design that this works. –  bmike Aug 24 '11 at 0:51
    
I wrote that in the comment above but I did not rewrite it in the answer. Wopps –  Luke Morgan Aug 24 '11 at 6:25
add comment

The sqlite version is outdated anyway. I suggest you go over here http://www.sqlite.org/ and download the current client. (Yes Apple is one of the sponsors. they use SQLite a lot for their apps, eg Mail for instance)

If you are looking for the framework, that is only included in the base installation. Have a look here for a similar problem and solution: http://superuser.com/questions/251647/restore-sqlite3-on-mac-os-x-for-google-chrome

share|improve this answer
add comment

Another trick is to extract the file from your installer disc. You can either open the .mpkg and look for the specific installer .pkg and extract the contents wholesale out of the .bom archive

An alternative is that you can use a utility like Pacifist to do the job for you. (I've never used Pacifist, it costs a small amount of money).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.