Cannot upload sketch

I am trying to use an Arduino Leonardo but I cannot upload a sketch to it. Details are:
OS is Linux Mint 19.3
I installed the Arduino IDE without problems, plugged in the Leonardo board and selected the port, then compiled the Blink example sketch. So far so good. When I try to upload this message appears:

Sketch uses 3956 bytes (13%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(
at cc.arduino.UploaderUtils.upload(
Caused by: Error touching serial port ‘/dev/ttyACM0’.
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(
… 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
at jssc.SerialPort.openPort(
… 6 more

Seems to be a problem with permissions. Can anyone suggest a solution, please?

You probably need to make yourself a member of the dialout group.

On Mint (and probably Ubuntu) you also need to disable the modemmanager service which is installed by default and scans serial ports for serial modems. No doubt the intent was well meaning but it mucks up the serial comms for 32u4 boards with CDC serial ports.

Thanks for the suggestion but the problem persists.
I’ve removed modemmanager and run the terminal commands “chown <my_user_name> ttyACM0” and also “chmod 777 ttyACM0” but I still get this error message:

An error occurred while uploading the sketch
avrdude: ser_open(): can’t open device “/dev/ttyACM0”: Permission denied

So, any ideas as to what to try next, please?

Ah, all my fault for not fully reading the installation guide.
I needed to add myself to the Dialout group (whatever that is):

sudo usermod -a -G dialout

Now it all works nicely.

johnb276: I needed to add myself to the Dialout group (whatever that is):

As I said :D