This error can be seen if a previous installation was interrupted and to clear this lock file run
sudo rm /var/lib/dpkg/lock
If the problem persists, check your internet connection as it may not be stable causing the interruption.
It is also good practice to update any existing components before installing any new ones.
sudo apt update && sudo apt full-upgrade
will update any installed components.
If you still have a problem, please contact us with the Codio username, project name and the package you are trying to install and we can take a closer look