Wow, how is the documentation for this so terrible? At the time of writing, the documentation on the official site literally says:
5.3. Configuring, building, and installing
WRITEME :-P (PKG_CONFIG_PATH, ./configure, make, make install, /etc/ld.so.conf, LD_LIBRARY_PATH, PATH, yadda yadda)
Here's how I installed it (on Ubuntu 18.04 LTS) after lots of trial and error. Keep in mind that gphoto2
is simply the CLI for libgphoto2
. Simply installing gphoto2
won't do much for you.
Easy method
Use apt
(or apt-get
)
$ sudo apt install gphoto2
$ sudo apt install libgphoto2-6
You may be wondering why it's libgphoto2-6
and not just libgphoto2
. When you're typing sudo apt install libgphoto2
press tab
and see what it completes. You can also view what the latest packages are for each ubuntu build. Launchpad and packages.ubuntu.com.
After that you should be able to use gphoto2 in Terminal.
$ gphoto2 -v
should show you something meaningful.
Advanced build
If you go to the gphoto2 website, you'll notice that they've released updates to libgphoto2
since Ubuntu 18.04's latest package (2.5.16). Specifically, I want to have support for Sony Alpha A9, which requires libgphoto2 v2.5.22
. You can download it from the source, but now what?
cd
to the tar.bz2 file.
unzip it: autocomplete the file name by pressing tab
$ tar -xjf libgphoto2-2.5.22.tar.bz2
configure, make, make install Go into the directory. Each of these commands will take time, so enter one line at a time.
$ cd libgphoto2-2.5.22
$ autoreconf -is
$ sudo ./configure
$ sudo make
$ sudo make install
If at any point it says it looks like something went wrong, it's likely you're missing a package. I had to install: libtool
, libpopt-dev
, libsub-dev
, libexif-dev
, libjpeg-dev
, autoconf
, autopoint
, libcdk5-dev
The github repo has an additional step of
autoreconf -is
which for me, required apt install
ing the autoconf
and autopoint
packages.
This updates libgphoto2
. To update gphoto2
, which I needed to do in order to use libgphoto2-2.5.22, you have to go through the same steps. Read the README.md. I had to install libpopt-dev
. Running ./configure
alerted me to this problem.
You may need to restart Terminal or your machine to see changes.
After that, check your version using gphoto2 -v
.
Best Answer
According to NEWS file of
libgphoto2
the support for your camera was added in version 2.5.19.For Ubuntu this means that you need to have Ubuntu 18.10 (cosmic) or future 19.04 (disco). Both versions are non LTS.
So on Ubuntu LTS you need to compile
gphoto2
andlibgphoto2
by yourself.Below is the method for Ubuntu 18.04 LTS:
software-properties-gtk
)Install build tools and build dependencies for gphoto packages:
Clone source code from Debian (we will get version 2.5.20-3 for both gphoto2 and libphoto2 for compatibility):
Check that gphoto packages were installed (compare with output below):
I do not have any DSLR for test, but I hope this method will work.
Also note that many GUI applications use gphoto2 library as back-end to communicate the camera. You can try digiKam, DarkTable, Entangle. All they have packages in official Ubuntu repositories.