ubuntu problem solving: waiting for cache lock: cannot obtain lock

ubuntu problem solving: waiting for cache lock: cannot obtain lock

Problem description (picture)

Waiting for cache lock: Unable to obtain lock /var/lib/dpkg/lock-frontend

When using Ubuntu system for apt installation of software packages, you will have the problem in the picture. The solution is as follows:

method 1

Type in terminal

sudo rm /var/lib/dpkg/lock-frontend

Method 2

If method 1 does not solve the problem , use this method

sudo rm /var/cache/apt/archives/lock

After entering the password, enter the following statement

sudo rm /var/lib/dpkg/lock

After using the method

For example, install ROS as shown in the figure

Guess you like

Origin blog.csdn.net/weixin_45108668/article/details/129907299