19

I am attempting to transfer files from my OnePlus X Android phone to my fairly fresh Ubuntu 16.10 installation. After the phone is mounted (and I can see file, navigate the filesystem etc.), when I attempt to transfer files from the phone to the Ubuntu system, I am presented with the following error message:

libmtp error:  Could not get file from device.

What might be going wrong here? I have previously installed libmtpserver-dev and mtp-server.

muru
  • 207,228
d3pd
  • 3,791

6 Answers6

9
  1. Install this dependency to build libmtp

    sudo apt-get install libusb-dev --install-suggests

  2. Get the libmtp here libmtp Latest Download

  3. Extract the file using a file explorer program [or via the terminal]

    tar xvf libmtp-1.1.1.tar.gz

  4. cd into the new directory you just extracted
  5. Configure (MAKE SURE YOU'RE ARE IN THE /libmtp-*/ DIR)

    ./configure --prefix=/usr make

  6. Install (AGAIN, MAKE SURE YOU'RE IN THE /libmtp-*/ DIR)

    sudo make install

  7. Copy rules to /etc/udev/rules.d/ (you might wanna double check the rules.d/ dir to see if coping over the new set of rules is necessary ... it probably is)

    sudo cp 69-libmtp.rules /etc/udev/rules.d

  8. Install the gMTP GUI Util

    sudo apt-get install gmtp --install-suggests

  9. Open/Run the gmtp program from the menu or term and enjoy!

NOTE: If you have issues you might need to disconnect the device. Or restart. Or update things... sudo apt-get update and/or sudo apt-get upgrade

Hope this helps, if so vote up. If more help is needed hit me up and I'll do what I can.

3

I faced a problem because the filename has a Diamond character in the filename. Removing it the transfer worked. It seems the transfer had problem with filename containing unicode chars.

1

According to ArchWiki:

It seems that it is caused by file with name like 20180915_180351(0).jpg. Samsung phones for example like to create files with such names.

giammi56
  • 140
0

I wanted to transfer photos, and had to switch usb connection mode from file to photo on my phone (Android 10).

tinlyx
  • 3,328
Daniel
  • 43
0

Copying files from the DCIM/Camera folder up a directory, directly under DCIM, helped (especially with stubborn images or very large videos: 200-300 MB). If the error appeared again, I would initially:

sudo killall gvfsd
nautilus -q

… but after a while I noticed that simply changing Android preferences from file transfer/Android Auto to USB tethering and then back seemed to suffice as a refresh so I could try again.

One particularly stubborn video required that I copy and paste it into a new directory that I just made up, DCIM/test, and then I was able to finally cut it from there to my computer.

This worked! I just needed to fiddle around with it a lot.

zulu
  • 131
0

@Anovative's answer is what worked for me.

New LG G6 would not mount properly on Ubuntu 14.04.5. It half-worked; I could navigate the file structure in my phone. Retrieving files didn't work though.

Error details were often:

libmtp error: call to ptp_mtp_getobjectpropssupported() failed

or

libmtp error:  Could not get file from device

Downloaded libmtp-1.1.14, compiled, installed the shared library, had to move things around a bit so the new .so was pointed at, now everything works just fine.

studog
  • 200