user86896: Dealing with this very common issue on IDE v2.0.0., but not sure why.
I should be fine group-wise:
adm tty dialout cdrom sudo dip plugdev lpadmin lxd sambashare docker

I've also seen numerous suggestions to change the device's permissions directly via chmod a+rw /dev/<device>. This is terrible advice, but nothing is working so far, so I tried it anyway. It also doesn't work, as at some point during the upload process, the device is removed and recreated, resetting the permissions.
edit: I've also ensured that ModemManager is not running, and has been purged from the system.
Running the IDE as root always fails, including when the --no-sandbox argument is passed.
I'm using the AppImage download on Ubuntu 22.04, but I tried the zip download, with the same results.
edit: Previously in this spot was a note about this problem not occurring on IDE v. 1.8. That wasn't actually the case - I was just testing with a board that doesn't remove and re-create the device on upload. Using a board where that does occur (Arduino Micro in this case), the error occurs in 1.8 as well.
Using avrdude directly (as my normal user account) also works just fine.
Additional observation - when the device is recreated by the OS after plugging the Arduino board in, it's first created with crw------- 1 root root permissions, and remains in that state for a very short period of time before switching to crw-rw----+ 1 root dialout permissions, at which point uploads work as expected.

user86896: After a long debugging session in chat, we've determined that a udev entry installed by the apt package laptop-mode-tools takes a long time to run, leading to the permissions not settling on the USB device until after the IDE has attempted to upload.
This problem happens even when laptop-mode isn't enabled because you're e.g. using AC. You don't need to be actually using a laptop for this problem to occur, as laptop-mode-tools is a generic power-saving package that can be installed anywhere.
The udev rule in question is ACTION=="add", SUBSYSTEM=="usb", RUN+="lmt-udev force" in the file  /lib/udev/rules.d/99-laptop-mode.rules.
Commenting out that udev rule, or changing force to auto resolves the problem for me (without needing to restart udev, or anything else).
Larger hammers that can be used to resolve this include setting ENABLE_LAPTOP_MODE_TOOLS to 0 in /etc/laptop-mode/laptop-mode.conf, or simply removing laptop-mode-tools from the system entirely.
@timemage gets the credit for this fix.

86896: <p>Dealing with this very common issue on IDE v2.0.0., but not sure why.</p>
<p>I should be fine group-wise:</p>
<pre class="lang-bash prettyprint-override"><code>adm tty dialout cdrom sudo dip plugdev lpadmin lxd sambashare docker
</code></pre>
<p>I've also seen numerous suggestions to change the device's permissions directly via <code>chmod a+rw /dev/&lt;device&gt;</code>. This is terrible advice, but nothing is working so far, so I tried it anyway. It also doesn't work, as at some point during the upload process, the device is removed and recreated, resetting the permissions.</p>
<p>edit: I've also ensured that ModemManager is not running, and has been purged from the system.</p>
<p>Running the IDE as root always fails, including when the <code>--no-sandbox</code> argument is passed.</p>
<p>I'm using the AppImage download on Ubuntu 22.04, but I tried the zip download, with the same results.</p>
<p>edit: Previously in this spot was a note about this problem not occurring on IDE v. 1.8. That wasn't actually the case - I was just testing with a board that doesn't remove and re-create the device on upload. Using a board where that does occur (Arduino Micro in this case), the error occurs in 1.8 as well.</p>
<p>Using <code>avrdude</code> directly (as my normal user account) also works just fine.</p>
<p>Additional observation - when the device is recreated by the OS after plugging the Arduino board in, it's first created with <code>crw------- 1 root root</code> permissions, and remains in that state for a very short period of time before switching to <code>crw-rw----+ 1 root dialout</code> permissions, at which point uploads work as expected.</p>
 86896: <p>After a <a href="https://chat.stackexchange.com/rooms/139598/discussion-between-timemage-and-x1a4">long debugging session in chat</a>, we've determined that a udev entry installed by the <code>apt</code> package <a href="https://github.com/rickysarraf/laptop-mode-tools" rel="nofollow noreferrer">laptop-mode-tools</a> takes a long time to run, leading to the permissions not settling on the USB device until after the IDE has attempted to upload.</p>
<p>This problem happens even when laptop-mode isn't enabled because you're e.g. using AC. You don't need to be actually using a laptop for this problem to occur, as laptop-mode-tools is a generic power-saving package that can be installed anywhere.</p>
<p>The udev rule in question is <code>ACTION==&quot;add&quot;, SUBSYSTEM==&quot;usb&quot;, RUN+=&quot;lmt-udev force&quot;</code> in the file  <code>/lib/udev/rules.d/99-laptop-mode.rules</code>.</p>
<p>Commenting out that udev rule, or changing <code>force</code> to <code>auto</code> resolves the problem for me (without needing to restart udev, or anything else).</p>
<p>Larger hammers that can be used to resolve this include setting <code>ENABLE_LAPTOP_MODE_TOOLS</code> to <code>0</code> in <code>/etc/laptop-mode/laptop-mode.conf</code>, or simply removing <code>laptop-mode-tools</code> from the system entirely.</p>
<p>@timemage gets the credit for this fix.</p>
