16

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
  • 193,181
  • 53
  • 473
  • 722
d3pd
  • 3,631
  • 12
  • 46
  • 73
  • Wich version of libtmp do you have? – M. Becerra Feb 02 '17 at 13:41
  • @M.Becerra Hey, I have `libmtpserver-dev` version `0.0.4+16.04.20160413-0ubuntu4` and `mtp-server` version `0.0.4+16.04.20160413-0ubuntu4`. – d3pd Feb 02 '17 at 15:01
  • 2
    Interestingly, I got the same message when my local HDD was out of space. Misleading error message, but when I made some space all files copied without problems (Ubuntu 16.04.2) – n3rd Aug 17 '17 at 15:10
  • I ran into this issue when transferring a large amount of photos from a phone before retiring it. One quick workaround I came up with was to first first put the files in an archive on the phone. For this I used the app ES File Explorer. I used zip as format but with compression set to store. Then I just transferred that archive instead. – Clox Jun 25 '18 at 07:30
  • use a usb port without a hub – tronic Aug 22 '19 at 14:07

5 Answers5

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

Rockin4Life33
  • 181
  • 2
  • 9
  • 1
    I'm on Ubuntu 16.04 and can confirm this works! thanks! – 9a3eedi Oct 02 '17 at 05:45
  • I tried this on my oneplus 3T Ubuntu 16.10 but gmpt says no device connected. When I do connect my oneplus 3T the CD mounts however but I cannot access the internal storage via file manager or gmtp. Thanks – twiz911 Oct 09 '17 at 05:01
  • @user894199 That sounds odd. Sorry, I wish I had some insight to help you out but I'm not sure what to do in your case. – Rockin4Life33 Mar 16 '18 at 22:20
  • On 16.04, have similar problem to Clox's. While transferring files with Nautilus, the transfer gets interrupted randomly with the error message in this topic. Steps from Anovative here worked for installing gmtp and might have helped Nautilus stay connected long enough to transfer some 1GB and larger files, which I could not do before following these steps. The gmtp program also got successfully installed, but cannot connect to the phone. When I click the connect button, Nautilus seems to take over and connect instead, and gmtp errors with "Detect: No available Storage found on device?" – Allan Tokuda Jul 29 '18 at 15:58
  • In fresh Ubuntu, got this 'no acceptable C compiler' (gcc was not installed), so did this before building libmtp -> 'sudo apt-get install build-essential'. – Abu Ruqaiyah Mar 14 '19 at 17:09
  • Hi @Anovative, when I give 'make' command, I'm getting this after some time: 'Makefile:506: recipe for target 'mtp-connect' failed'. I keep getting this everytime, any ideas why this may happen? – Abu Ruqaiyah Mar 14 '19 at 17:35
  • @AbuRuqaiyah, sorry for the really late response. I didn't notice the comment. I'm not sure what is going wrong — I've also seen this happen for `target 'smtp-connect'`. I don't have a good answer for you except to ensure that everything is up-to-date, especially the `build-essential` tools and any dependencies. It's also possible that downloading and compiling the latests `libmtp` might help. If all else fails, and I hate to suggest this, you can try running this as admin `sudo`; I really don't like nor encourage running w/elevated permissions unless it's really necessary. Good luck! – Rockin4Life33 Nov 25 '19 at 23:02
1

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.

Sergio Abreu
  • 204
  • 2
  • 8
0

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

tinlyx
  • 3,132
  • 6
  • 34
  • 53
Daniel
  • 43
  • 4
0

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
  • 100
  • 11
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
  • 191
  • 1
  • 5