So I don’t see the unattended upgrades enabled (which would run on startup). But I do see that you have some sort of caching going on with dnsmasq. Unfortunately, I don’t know if this is related or not (it could be perfectly normal).
I do see in “/etc/apt/apt.conf.d/” a file “20auto-upgrades”. I am going to suggest you move this somewhere else, e.g., assuming you are logged in as user “nvidia”:
sudo mv /etc/apt/apt.conf.d/20auto-upgrades ~nvidia/tmp/
…reboot, and try again. If it fails, verify if this file exists:
If this file still exists, and the update failed, try:
sudo pgrep -f 'dpkg|apt'
# then <i><b>for each process ID</b></i>, if any, run:
kill <process ID>
sudo rm /var/lib/dpkg/lock
…and try again (it is important to kill any existing “apt” or “dpkg” command first so it won’t corrupt a database by running two operations simultaneously…sometimes though the lock exists after an apt or dpkg failure and doesn’t go away when it should).
After that, if it all worked, then you can:
sudo mv ~nvidia/tmp/20auto-upgrades /etc/apt/apt.conf.d/
(this adds the auto update back in)
The reason for all of this trouble is that a new dpkg/apt operation is refusing to run due to something else already running…but we don’t know if something else is really running, or if instead a failed run left a lock. Eventually we get to the steps of either removing a stale lock or killing some automatic update which is running on each boot. If you’ve never run “sudo apt update; sudo apt-get upgrade”, then there is an enormous list of files to download and that could legitimately hold the lock open for hours or more.