3

I'm new to (K)ubuntu. Does anybody know how to install the gphoto2 software?

1

3 Answers 3

8

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 installing 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.

1
  • I believe "libsub-dev" should be "libusb-dev"
    – bcattle
    Commented Oct 27, 2022 at 21:30
2

Open a terminal and type

sudo apt install gphoto2 libgphoto2*

This should do it.

5
  • It works, GPhoto2 is downloaded, but how to open it? (Sorry for my stupidness) (sorry for my english too) Thanks #Cheese129
    – Cheese129
    Commented Apr 15, 2017 at 17:40
  • What exactly do you want to do? I learned that without libgphoto2, Ubuntu does not recognize SD cards with photos on it. I have never tried to control a camera through gphoto2, though.
    – user258532
    Commented Apr 15, 2017 at 20:32
  • I want to try to control a camera with gphoto2. But when i search for gphoto2 in the pc, there is no program called that. When i tries to install it again, it says it is downloaded. What to do? Thanks #Cheese129
    – Cheese129
    Commented Apr 16, 2017 at 8:33
  • I suggest opening another question here on askubuntu, because that's a different topic. Another idea is asking on photo.stackexchange.com .
    – user258532
    Commented Apr 16, 2017 at 13:08
  • I have now opened a new topic: askubuntu.com/questions/905453/…
    – Cheese129
    Commented Apr 16, 2017 at 13:18
1

gphoto2-updater (https://github.com/gonzalo/gphoto2-updater) compiles from the latest github source of gphoto2.

1
  • brilliant shortcut! Commented Apr 20, 2020 at 6:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .