Skip to content

Instantly share code, notes, and snippets.

@smac89
Last active January 25, 2024 03:27
Show Gist options
  • Star 40 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save smac89/251368c8df2ccd645baedc3e1238fdb4 to your computer and use it in GitHub Desktop.
Save smac89/251368c8df2ccd645baedc3e1238fdb4 to your computer and use it in GitHub Desktop.
Linux Fix Fastboot "no permissions, verify udev rules"

Determine your device id

  1. Unplug your device from the computer and type lsusb in the terminal. You should get an output similar to this:
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 003 Device 033: ID 0cf3:3004 Atheros Communications, Inc. AR3012 Bluetooth 4.0
Bus 003 Device 047: ID 045e:07fd Microsoft Corp. Nano Transceiver 1.1
Bus 003 Device 002: ID 174f:148d Syntek 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  1. Now plug your phone into the computer and run the command again, the output should be different:
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 003 Device 033: ID 0cf3:3004 Atheros Communications, Inc. AR3012 Bluetooth 4.0
Bus 003 Device 047: ID 045e:07fd Microsoft Corp. Nano Transceiver 1.1
Bus 003 Device 002: ID 174f:148d Syntek 
Bus 003 Device 060: ID 05c6:6765 Qualcomm, Inc. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  1. Take a note of the new output ID. For me it's Bus 003 Device 060: ID 05c6:6765 Qualcomm, Inc.

  2. The value we are interested in is the first one before the colon (:); in this case 05c6. You can check that the value you get is the same as the ones listed here

Note

On Arch Linux, it might be enough to install android-udev package, so you can skip the below steps. See ArchWiki#Adding udev rules

Some code

  1. Use your favourite text editor to edit the file: /etc/udev/rules.d/51-android.rules

  2. In the new file, enter the following:

# Phone name
SUBSYSTEM=="usb", ATTR{idVendor}=="id_you_copied", MODE="0666", GROUP="plugdev"
  1. Make sure to replace id_you_copied with the one we determined from the previous section

  2. Save and close the file.

  3. Now in the terminal, run the following commands

sudo chmod a+r /etc/udev/rules.d/51-android.rules
sudo systemctl restart udev

The first command is to make the file we created readable by all users (should be unless you've set a umask of 0027 or 0077) and the second command restarts the udev (usb device) manager, via systemd.

  1. Now you can try the command fastboot -l devices and it should successfully list your device as one of the entries
@rhaps0dy
Copy link

Works perfectly, thank you very much!

@willbroderick
Copy link

Thanks for the guide!
Just want to mention that sudo service udev restart didn't work for me - the device still didn't show up.
But it did after running this:

sudo udevadm control --reload-rules
sudo udevadm trigger

@mikehardy
Copy link

Super useful, thank you

@naziur-nahid
Copy link

Tnq so much... It is working well.

@moonsua
Copy link

moonsua commented Oct 9, 2019

Thank you. It's working!!

@elzdave
Copy link

elzdave commented Mar 11, 2020

for fedora user, instead of using sudo systemctl restart udev you needs to run the following command sudo systemctl restart systemd-udevd

@NightlyDeveloper
Copy link

Thank you so so so much!!!! But(ik on Arch, Manjaro) "sudo systemctl restart udev" didn't work for me, it said udev not found. I fastboot devices and still didn't have permissions, so I restarted my laptop and it worked. Again, THANK YOU!

@yalcinozer
Copy link

Thanks for the guide!
Just want to mention that sudo service udev restart didn't work for me - the device still didn't show up.
But it did after running this:

sudo udevadm control --reload-rules
sudo udevadm trigger

Thanks

@planetoryd
Copy link

Thanks for the guide! Just want to mention that sudo service udev restart didn't work for me - the device still didn't show up. But it did after running this:

sudo udevadm control --reload-rules
sudo udevadm trigger

Works

@acidmange
Copy link

thank you very much!

@xiufenyu
Copy link

sudo udevadm control --reload-rules
sudo udevadm trigger

I also needs the two commands above. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment