Unable to upload code to Arduino Nano, getting error, "avrdude: stk500_getsync() attempt 1 of 10"

I am using a generic Arduino Nano (sold in China) and unable to upload a my code.The device is working OK. I checked with my MacBook Pro and it was also working fine with Ubuntu Linux before I switch Distros.

I’ve gone through the exact same steps to set things up. Added $USER to the dialout group,

$ ls -l /dev/ttyU*

crw-rw---- 1 devguy dialout 188, 0 Mar  4 07:14 /dev/ttyUSB0

Checked device is attached to the USB port

$ lsusb

Bus 001 Device 010: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

I’ve used dmesg to check the device exists, here is the output

 4047.295097] usb 1-8: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.62
 4047.295099] usb 1-8: New USB device strings: Mfr=0, Product=2, SerialNumber=0
 4047.295100] usb 1-8: Product: USB2.0-Serial
 4047.332500] usbcore: registered new interface driver usbserial_generic
 4047.332505] usbserial: USB Serial support registered for generic
 4047.333609] usbcore: registered new interface driver ch341
 4047.333614] usbserial: USB Serial support registered for ch341-uart
 4047.333625] ch341 1-8:1.0: ch341-uart converter detected
 4047.342834] usb 1-8: ch341-uart converter now attached to ttyUSB0

I believe this device is ch341 compatible

$ lsmod|grep ch341

ch341                  20480  0
usbserial              61440  1 ch341
usbcore               315392  9 usbserial,xhci_hcd,snd_usb_audio,usbhid,snd_usbmidi_lib,uvcvideo,btusb,xhci_pci,ch341

Maybe the problem is the “ch341” module is not getting loaded? This command does not output anything.

sudo modprobe ch341

The device connection is on ttyUSB0, but the Arduino IDE refused to upload the code?