user69990: I am using arduino-ide2.0.0-beta.7(CLI Version:0.18.3 alpha) on Manjaro Linux and I get this error when uploading sketch to my Arduino Micro:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
Upload error: Error: 2 UNKNOWN: uploading error: uploading error: exit status 1

I checked other questions and tried:
sudo groupadd dialout
sudo gpasswd -a $USER dialout
sudo chmod a+rw /dev/ttyACM0
sudo usermod -a -G dialout $USER  
sudo chown root:dialout -R /dev/
ls -l /dev/ttyACM0 #can see the root:dialout 

But when I logout and get again after ls -l /dev/ttyACM0:

crw-rw-rw- 1 root uucp 166, 0  6月 13 17:06 /dev/ttyACM0

So I cannot upload the sketch. Note: I can upload sketches using sudo arduino-ide --no-sandbox , but I want to upload them from the user account.
What else can I try?
Thank you.

user69990: Instead of:
sudo usermod -a -G dialout $USER 

I had to run:
sudo usermod -a -G uucp $USER 

Thanks to @Juraj I realized that. Thanks @Juraj.

69990: <p>I am using <code>arduino-ide</code>2.0.0-beta.7(CLI Version:0.18.3 alpha) on Manjaro Linux and I get this error when uploading sketch to my Arduino Micro:</p>
<blockquote>
<p>avrdude: ser_open(): can't open device &quot;/dev/ttyACM0&quot;: Permission denied
Upload error: Error: 2 UNKNOWN: uploading error: uploading error: exit status 1</p>
</blockquote>
<p>I checked other questions and tried:</p>
<pre><code>sudo groupadd dialout
sudo gpasswd -a $USER dialout
sudo chmod a+rw /dev/ttyACM0
sudo usermod -a -G dialout $USER  
sudo chown root:dialout -R /dev/
ls -l /dev/ttyACM0 #can see the root:dialout 
</code></pre>
<p>But when I logout and get again after <code>ls -l /dev/ttyACM0</code>:</p>
<blockquote>
<p>crw-rw-rw- 1 root uucp 166, 0  6月 13 17:06 /dev/ttyACM0</p>
</blockquote>
<p>So I cannot upload the sketch. Note: I can upload sketches using <code>sudo arduino-ide --no-sandbox </code>, but I want to upload them from the <code>user</code> account.</p>
<p>What else can I try?</p>
<p>Thank you.</p>
 69990: <p>Instead of:</p>
<pre><code>sudo usermod -a -G dialout $USER 
</code></pre>
<p>I had to run:</p>
<pre><code>sudo usermod -a -G uucp $USER 
</code></pre>
<p>Thanks to @Juraj I realized that. Thanks @Juraj.</p>
