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.
processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2047)
at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port ‘/dev/ttyACM0’.
at processing.app.Serial.touchForCDCReset(Serial.java:107)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
… 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
at jssc.SerialPort.openPort(SerialPort.java:170)
at processing.app.Serial.touchForCDCReset(Serial.java:101)
… 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