dpkg – I get this error when trying to use apt-get install

I tried to install and upgrade my system but some errors are occurred.I search these type of problem solutions on askubuntu side but any solution did not work.these are some errors like:

$ sudo apt-get install python3
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

$ sudo dpkg --configure -a
dpkg: error: dpkg frontend is locked by another process