How to compile DB Browser for SQLite on Ubuntu 16.04
Ubuntu 16.04.x comes with an old version of Qt (5.5), causing some bad issues for DB Browser for SQLite (DB4S):
- https://github.com/sqlitebrowser/sqlitebrowser/issues/920
- https://github.com/sqlitebrowser/sqlitebrowser/issues/1001
Not everyone will hit those problems, but if it happens to you there is a solution.
If you compile DB4S yourself using the steps shown below, you’ll have a working DB4S without the above issues.
Install the Ubuntu software needed for compiling DB4S
$ sudo apt install build-essential git cmake libsqlite3-dev qt5-default \
qttools5-dev-tools
Get the latest DB4S source code
Clone the sqlitebrowser/sqlitebrowser git repo:
$ git clone https://github.com/sqlitebrowser/sqlitebrowser
Download and install Qt 5.7 or above
Grab the Qt installer then run it:
$ wget http://www.mirrorservice.org/sites/download.qt-project.org/archive/online_installers/2.0/qt-unified-linux-x64-2.0.5-2-online.run
$ chmod 755 qt-unified-linux-x64-2.0.5-2-online.run
$ ./qt-unified-linux-x64-2.0.5-2-online.run
The Qt installer will appear:
If you have an (optional) Qt account, you can fill in the details. Otherwise just click the “Skip” button:
The Qt installer “welcome” screen will appear now. Click next through the next few screens, until it asks where you want to install:
By default, Qt will install into a “Qt” directory in your home folder. That seems to work well, but if you need to change it for some reason then this screen is where you do it. Click “Next” once you’re happy with the chosen location:
This screen will have several component selected by default. You don’t need anything other than Desktop gcc 64-bit
(or 32-bit if compiling on 32-bit Ubuntu), and Qt Creator (down the bottom). The rest you can safely de-select before clicking “Next” to continue:
Agree to the Qt license conditions (if you’re ok with them), then click Next:
Click “Install” to begin the actual installation process:
Qt is now installed. Leave the “Launch Qt Creator” option enabled so it gets launched automatically when you click “Finish”:
Build DB Browser for SQLite
The welcome screen for Qt Creator appears. Click the “Open Project” button near the middle top, browse into the “sqlitebrowser” folder, then select the sqlitebrowser.pro
file, and open it:
A screen called “Configure Project” will appear. There are three main checkboxes in it → Debug
, Release
, and Profile
. Unselect the Debug
and Profile
ones, so only Release
is left enabled. Then click the Configure Project
button:
This drops you into the “Edit” layout, with no documents open. Click the “Projects” tab on the left to switch to the projects layout so we can made further changes:
You’re now in the Projects layout, which shows the “Build Settings” by default. “Shadow build” will be enabled. We don’t want that, so disable it:
This screenshot shows “Shadow build” disabled, which is what we want:
Now from the Qt Creator menu in the top bar, choose Build → Run qmake:
Wait a few seconds for it to finish, then choose Build → Build All, also from the Qt Creator menu in the top bar:
DB Browser for SQLite is now being built. It can take a few minutes, so be patient until it completes:
If all goes well, the build should finish without errors, looking somewhat like this:
If the build process finishes with any errors though, sometimes running Build → Build All again (as per the previous step) fixes the problem, and is worth trying.
If you want SQLCipher support, follow this step.
Install DB Browser for SQLite
Still needs writing