If you get the following error when trying to connect your Ledger Nano or Nano X to your Linux PC via MetaMask, it is because your ‘udev’ rules are not setup:
‘The Ledger device failed to open. Your Ledger might be connected to other software. Please close Ledger Live or other applications connected to your Ledger device, and try to connect again.’
The following command usually corrects the problem by setting the ‘udev’ rules. Try connecting it again after running the command.
wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash