Sqlite and libssl-dev Install Problem

Perm URL with updates: http://xahlee.info/linux/linux_ruby_sqlite_install_error.html

Sqlite and libssl-dev Install Problem

Summery. If you are trying to install Ruby on Rails on Ubuntu, and you got this error:

The following packages have unmet dependencies:
 libsqlite3-dev : Depends: libsqlite3-0 (= 3.7.9-2ubuntu1) but 3.7.9-2ubuntu1.1 is to be installed
 libssl-dev : Depends: libssl1.0.0 (= 1.0.1-4ubuntu5.8) but 1.0.1-4ubuntu5.9 is to be installed
 sqlite3 : Depends: libsqlite3-0 (= 3.7.9-2ubuntu1) but 3.7.9-2ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.

The problem is probably because you disabled one of the repository source in update-manager.

To fix, start update-manager &, then in the “settings” button at bottom, in “Updates” tab, make sure you check box the “Recommended updates (precise-updates)”.

linux update-manager screenshot 2013-06-03
linux update-manager screenshot

Manual Fix Using 「dpkg」

If you search the web, you might find a few page that tries to tell you how to fix it by using dpkg. For example, these:

That would work, but is very dangerous and error-prone. If the problem is a turned-off source repository, you better turn it back on, else you'll need to manually fix lots of other packages.

If the problem is not repository source, here's how you can fix it manually.

  • First, go to Ubuntu package site http://packages.ubuntu.com/, and find the package you want. Be sure the Ubuntu version and 32/64 bits architecture matches yours.
  • Download the 32bits and 64 bits “.deb” packages.
  • Force remove the packages on your system, by, for example, sudo dpkg --force-depends --purge libsqlite3-0. WARNING: dangerous. This better not be a production system, unless you know what you are doing.
  • Install the ones you downloaded. Like this: sudo dpkg --install /home/xah/Downloads/libsqlite3-0_3.6.22-1_i386.deb. You might need to install both 32bits and 64bits versions, i'm not sure.

See also: Linux: Package System {dpkg, apt-get} Tutorial.

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs