Ubuntu found an error during apt operation [How to Solve]

1. An error will be reported during apt install. The error content is: couldn’t resolve host mirrors aliyun.com

Cause of problem: the domain name resolution server needs to be configured because the domain name cannot be resolved.

Solution:

— vi /etc/resolv.conf

Add at the end of the text

nameserver 8.8.8.8

nameserver 114.114.114.114

2.ubuntu Apt-get error
ubuntu use apt-get error:
E: Could not get lock /var/lib/dpkg/lock – open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

Solution:
1.delete the lock file
sudo rm /var/lib/apt/lists/lock
2.delete the lock file in the cache directory
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

3.ubuntu apt-get  Unable to locate package
Reason:
Unable to locate packet Just can’t find the package
Solution:
— apt-get update


Read More: