SQLite Forum

how to force python to use recent sqlite3 version
Login
That method will fail every time the OS provider delivers a new binary package, because installing the upgrade will overwrite your library.

You'd do better to either:

1. Remove the OS package so that all library users switch over to the copy in `/usr/local/lib` instead. This may mean suppressing warnings from your package management system.

2. Do what you did, but mark the package non-upgradeable in your OS's package manager configuration. It is then your responsibility to keep the package maintained.

3. Clone your OS's package scripts and substitute the new version in. For a Red Hattish system, this means taking the `*.spec` file, editing it with the updated versions, and then doing an `rpmbuild --rebuild` on the new spec file + tarball combo. For Debian type Linuxes, it's been too long since I did it to give useful advice. However you arrange it, this method avoids the problem because your version will forever be greater than whatever your OS provider offers.

4. Find a sufficiently closely-related OS that ships a newer compatible package, rebuild its source package for your OS, and use that instead. e.g. Ubuntu for Debian, Fedora for CentOS, etc.

Personally, I'd pick #3, but that's in part because I've maintained OS packages before, so it's not a new skill for me.