If you are getting this error, then have to remove this lock using following command. sudo rm /var/lib/apt/lists/lock Additionally, You may also need to delete the lock file in the cache directory sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock Now, try to run your previous command to install python3.6