Dpkg error dpkg status database is locked by another process

dpkg: ошибка: база данных статуса dpkg заблокирована другим процессом Мне просто интересно, может кто-нибудь сказать мне, что это значит: Как мне запустить sudo dpkg —configure -a вручную? 10 ответов Затем убедитесь, что процесс не запущен: Убедитесь, что процесс завершен: Затем удалите файл блокировки: Дайте самому dpkg исправить: После этого у вас все будет хорошо:) […]

Содержание

  1. dpkg: ошибка: база данных статуса dpkg заблокирована другим процессом
  2. 10 ответов
  3. dpkg: ошибка: база данных статуса dpkg заблокирована другим процессом
  4. 10 ответов
  5. dpkg status database is locked by another process #82
  6. Comments
  7. Fix DPKG: Error: DPKG Frontend Lock is Locked By Another Process
  8. How to Fix ‘E: Could not get lock /var/lib/dpkg/lock’ Error in Ubuntu Linux
  9. Fixing “Unable to lock the administration directory (/var/lib/dpkg/)” error
  10. Method 0:
  11. Method 1:
  12. Method 2
  13. Troubleshooting 1: “Unable to acquire the dpkg frontend lock”
  14. Troubleshooting 2: “dpkg: error: dpkg frontend is locked by another process”

dpkg: ошибка: база данных статуса dpkg заблокирована другим процессом

Мне просто интересно, может кто-нибудь сказать мне, что это значит:

Как мне запустить sudo dpkg —configure -a вручную?

10 ответов

Затем убедитесь, что процесс не запущен:

Убедитесь, что процесс завершен:

Затем удалите файл блокировки:

Дайте самому dpkg исправить:

После этого у вас все будет хорошо:) [ 1112]

Это может произойти, если процесс обновления был прерван (как будто ваше соединение было потеряно). Вы можете попробовать использовать screen в качестве root ( sudo su ), чтобы вернуться в сессию.

Вы не можете запускать несколько пакетов приложений / команд / инструментов одновременно. Иногда это означает, что в фоновом режиме работают synaptic, apt-get или инструмент обновления пакетов. Просто закройте другие инструменты пакета или дождитесь их завершения. И dpkg будет работать.

Можно также попробовать:

Исправить все поврежденные пакеты:

Исправить; попытаться исправить систему с нарушенными зависимостями. Эта опция, когда используется с установкой / удалением, может пропустить любые пакеты, чтобы позволить APT вывести вероятное решение. Если указаны пакеты, они должны полностью устранить проблему. Эта опция иногда необходима при первом запуске APT; Сам APT не позволяет существующим в системе нарушенным зависимостям пакетов. Вполне возможно, что структура зависимости системы может быть настолько повреждена, что потребует ручного вмешательства (что обычно означает использование dselect(1) или dpkg —remove для устранения некоторых пакетов-нарушителей). Использование этой опции вместе с -m может привести к ошибке в некоторых ситуациях. Элемент конфигурации: APT :: Get :: Fix-Broken.

Источник

dpkg: ошибка: база данных статуса dpkg заблокирована другим процессом

Мне просто интересно, может кто-нибудь сказать мне, что это значит:

Как я бегу sudo dpkg —configure -a вручную?

10 ответов

Затем убедитесь, что процесс не запущен:

Если он работает:

Убедитесь, что процесс завершен:

Затем удалите файл блокировки:

Позвольте dpkg исправить себя:

Вы должны быть в порядке потом:)

В нашем случае не было запущенного процесса (PID), поэтому я жестко остановил и перезагрузил VPS.

Далее, есть несколько файлов блокировки, которые, возможно, потребуется удалить:

Тогда вы можете исправить dpkg как предложено:

Можно также попробовать:

Чтобы исправить любые сломанные пакеты:

Fix; попытаться исправить систему с нарушенными зависимостями. Эта опция, когда используется с установкой / удалением, может пропустить любые пакеты, чтобы позволить APT вывести вероятное решение. Если указаны пакеты, они должны полностью устранить проблему. Эта опция иногда необходима при первом запуске APT; Сам APT не позволяет существующим в системе нарушенным зависимостям пакетов. Вполне возможно, что структура зависимостей системы может быть настолько повреждена, что потребует ручного вмешательства (что обычно означает использование dselect(1) или же dpkg —remove устранить некоторые из оскорбительных пакетов). Использование этой опции вместе с -m может привести к ошибке в некоторых ситуациях. Элемент конфигурации: APT::Get::Fix-Broken.

Источник

dpkg status database is locked by another process #82

I am deploying an ARM template (you can find it here) with a custom linux extension (you can find it here).
This extension is basically doing some apt-get install and then manually installing a package with dpkg .

The VM this extension is attached to is based on a custom image (generalized from Ubuntu 16.04).

The extension will fail on dpkg , with error:
dpkg: error: dpkg status database is locked by another process

It’s worth noting that while apt-get install seems to work fine, it also complains similarily:
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?

I did not install any other extensions.

I added a ps ax | grep dpkg in the script to see if something else was using dpkg, but it doesn’t seems so.

If I add a sleep 10m at the start of my script everything works fine, so it seems that my custom extension is executed before the VM is fully ready.

Content of /var/lib/waagent for reference

The text was updated successfully, but these errors were encountered:

@wbuchwalter this error happens often often there’s another extension implicitly installed on your machine and it’s going through another installation with apt concurrently. However your /var/lib/waagent folder shows only CustomScript extension, so I’m guessing that’s not the case.

Couple of things to note, you don’t need to use sudo in your script (your script runs as root) and you can make use of set -e mode so that if any command in your script fails, it’ll exit immediately (bash does not do this by default). [more info] This may help you debug the issue better.

Another possibility is, maybe you ran some apt based commands and while you’re running them CustomScript kicked in. This would also cause the lock file issue. Do you reuse the same VM or create a new VM every time you deploy the template?

It might be helpful to see apt and dpkg logs (they should be under /var/log as well). Those can give us a good idea of timeline of dpkg/apt events. I’m fairly certain some other installation/update was going on simultaneously as CustomScript.

Источник

Fix DPKG: Error: DPKG Frontend Lock is Locked By Another Process

In this article we are going to learn ‘Fix dpkg: error: dpkg frontend lock is locked by another process’. Whenever we are installing software, an error occurs with ‘dpkg: error: dpkg frontend lock is locked by another process’. dpkg is a free operating system software at the bottom of the package management system in Debian and its numerous derivatives. dpkg is used to install, remove, and supply information about .deb packages.

The dpkg (Debian package) itself is a low-level tool. APT (Advanced Package Tool), a high-level tool, is more commonly used than dpkg because it can bring packages to remote locations and deal with complex package relationships such as dependency fixes. Frontends like Aptitude (NCRS) and Synaptic (GTK +) are used for their friendly interface for APT.

The Debian package “dpkg” provides the dpkg program, as well as many other programs required for the run-time operation of the packaging system, including DPKG-DEB, DPKG-Split, DPKG-Query, DPKG-Statoveride, DPKG-Diverse, and DPKG. Trigger.

This includes programs like Update-Option and Start-Stop-Demon. The install-info was used to include the program as well but was later removed because it has now been developed and distributed separately. The Debian package “DPKG-Dev” contains the numerous build tools described below.

Follow the below steps to Fix DPKG: Error: DPKG Frontend Lock is Locked By Another Process

If you find the “dpkg: error: dpkg frontend lock is locked by another process” error while running the procedure described above, you need to do an extra step. First, find the ID of the process that contains the lock file. You can do so using below command.

Then make sure the process is not running.

The above command will give you the process PID using lock files. Use this PID to kill the process.

That’s all, In this article, we have explained the Fix dpkg: error: dpkg frontend lock is locked by another process. I hope you enjoy this article. If you like this article, then just share it. If you have any questions about this article, please comment.

Источник

How to Fix ‘E: Could not get lock /var/lib/dpkg/lock’ Error in Ubuntu Linux

Recently I was trying to install an application using the apt command on Ubuntu when I encountered the following 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?

In fact, there is a similar error you may see:

E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
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?

In some cases, you might see it while using the Software Center:

Could Not Get Lock Error in Ubuntu Software Center

These errors are very similar to another common Ubuntu error, Unable to lock directory /var/cache/apt/archives/, and the interesting thing is that the fixes are similar as well.

Fixing “Unable to lock the administration directory (/var/lib/dpkg/)” error

You see this error because some other program is trying to update Ubuntu. When a command or application is updating the system or installing a new software, it locks the dpkg file (Debian package manager).

This locking is done so that two processes don’t change the content at the same time as it may lead to unwarranted situation and a possible broken system.

Let’s see what steps can you take to fix this issue of ‘unable to lock administration directory’.

Method 0:

The first thing you should do is to check if some other program could be running system update or installing a program.

If you are using command line, check if an application like Software Center, Software Updater, Synaptic package manager, Gdebi is running any update/installation. If that’s the case, please wait for the program to finish the running process.

If there is no such application running, please check all the open terminal windows and see if you are running an update or installing a program. If yes, wait for it to finish.

If none of the above is happening, check which other process is running the apt command (package manager for handling software). Use this command:

For me, it showed this output:

If you see that apt is being used by a program like apt.systemd.daily update, you are in luck, my dear reader.

This is a daemon that runs in the background and check for system updates automatically when you start your system.

In Ubuntu 18.04 and higher versions, it may even try to download and install the important security updates on its own. At least this is what I see in the default settings in Software & Updates tool on the Ubuntu desktop.

Ubuntu may install security updates in background

If you are on Ubuntu server, you may check whether you have unattended upgrades enabled by checking the content of the file /etc/apt/apt.conf.d/20auto-upgrades.

So if you see apt.systemd.daily is using the apt process, all you have to do is to wait for a few minutes. When the automatic update finishes, you should be able to install your software as usual.

As a permanent solution, you may disable the check for automatic update and unattended upgrades altogether however I won’t advise that for security reasons.

Now, that was the simple scenario and it could be handled easily. But that might not always be the case. If some other program is using apt, you need to handle it differently.

Method 1:

Use the Linux command line to find and kill the running process. To do that, use the command below:

This will show you the id of the process running apt or apt-get. In the example below, the process id is 7343. You can ignore the last line containing ‘grep –color=auto’.

You can use the process id to terminate it by sending the SIGTERM signal. Replace the

with the number you got in the output of previous command.

Check if the process was killed by running the ‘ps aux | grep -i apt’ command. If it is still running, force kill it with SIGKILL signal:

Another easier way would be to use the killall command. This will kill all the instances of a running program:

Method 2

The above method would fix the problem for you in most cases. But my case was a bit different. I was updating my system and accidentally closed the terminal. For that reason, there were no processes running apt, but it still showed me the error.

In this case, the root cause is the lock file. As mentioned earlier, the lock files are used to prevent two or more processes from using the same data. When apt or apt-get commands are run, they create lock files in a few places. If the previous apt command was not terminated properly, the lock files are not deleted and hence they prevent any new instances of apt-get or apt commands.

To fix the problem, all you need to do is to remove the lock files. But before you do that, it would be a good idea to stop any process that is using the lock files.

Use the lsof command to get the process ID of the process holding the lock files. Check the error and see what lock files it is complaining about and get the id of the processes holding these lock files.

Run these commands one by one.

It’s possible that the commands don’t return anything, or return just one number. If they do return at least one number, use the number(s) and kill the processes like this (replace the

with the numbers you got from the above commands):

You can now safely remove the lock files using the commands below:

After that, reconfigure the packages:

Now if you run the sudo apt update command, everything should be fine.

Troubleshooting 1: “Unable to acquire the dpkg frontend lock”

If you see an error like this:

You should find out which process is holding the lock-frontend using the lsof command as discussed in previous sections:

This is what it showed for me:

If you see ‘unattende‘ COMMAND column, this means unattended security upgrades are running. You should wait for the process to finish. Basically, this is what I discussed in method 0 but you probably skipped that.

If the COMMAND is something else, you may kill the process and then remove the lock file. You can see the process id under the PID column. Use this PID to kill the process. After that, remove the lock file and run the update command to see if it’s been fixed.

What’s that lsof: warning can’t stat() fuse.gvfsd-fuse file system?

Note: If you see “lsof: warning can’t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete” lines after running the earlier mentioned lsof command, don’t panic.

That’s not an error. It’s just that lsof tries to look into mounted file systems as well and the warning is about those mounted systems.

The files are locked by the processes on your main filesystem so if it shows some warning and no output, this only means that there is no process using those lock files.

Troubleshooting 2: “dpkg: error: dpkg frontend is locked by another process”

If you see the error “dpkg frontend is locked by another process” while running the steps in method 2, you need to one additional step.

First, find out the id of the process that is holding the lock file.

The above command will give you the details of the processes using the lock files. Use the process ID to kill this program:

Now you can remove the lock and reconfigure dpkg:

Did it work for you? Which method fixed it for you?

I hope this small tip helped you fix the “Could not get lock /var/lib/dpkg/lock” error. If yes, please let me know which method worked for you in the comments.

If you are still facing issues, let me know. I’ll try to help you out.

Any other suggestions are also welcome in the comments.

Источник

  • Печать

Страницы: [1]   Вниз

Тема: [РЕШЕНО] Проблема при установке mysql server (5.1)  (Прочитано 2293 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
neonshark

Вчера попробовал установить сабж, у меня система (Ubuntu 10.04) зависла.

После ввода команды

sudo dpkg -C предлагает сконфигурировать следующие пакеты:

mysql-server
mysql-server 5.1
mysql-client
, но при вводе команды

sudo dpkg --configure mysql-server-5.1
выдается следующая ошибка:

dpkg: status database area is locked by another process
Что мне делать?

« Последнее редактирование: 29 Марта 2011, 12:00:59 от neonshark »


Оффлайн
easy2002

dpkg: status database area is locked by another process
Что мне делать?

synaptic закрыть

Tempora mutantur et nos mutantur in illis


Оффлайн
neonshark

synaptic закрыть

synaptic ом не пользовался (устанавливал через терминал (sudo apt-get install …)).


Оффлайн
Shtsh

сделай
ps aux | grep syn
ps aux | grep apt
ps aux | grep dpkg

И выводы всех этих команд сюда


Оффлайн
neonshark

$ ps aux | grep dpkg
root     13346  0.0  0.9   5148  2600 pts/1    Ss+  Mar28   0:00 /usr/bin/dpkg --status-fd 14 --configure libnet-daemon-perl libplrpc-perl libdbi-perl libdbd-mysql-perl mysql-client-core-5.1 mysql-client-5.1 psmisc mysql-server-core-5.1 mysql-server-5.1 libhtml-template-perl mysql-client mysql-server
root     13351  0.0  2.6   9948  7060 pts/1    S+   Mar28   0:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/mysql-server-5.1.postinst configure
root     13374  0.0  0.5   4240  1492 pts/1    S+   Mar28   0:00 /bin/bash -e /var/lib/dpkg/info/mysql-server-5.1.postinst configure

$ ps aux | grep apt
root      5180  0.0  6.8  21900 17856 ?        S    Mar28   0:00 apt-get install mysql-server mysql-client
denis    26404  0.0  0.2   3248   784 pts/2    S+   07:01   0:00 grep --color=auto apt

$ ps aux | grep syn
denis    26428  0.0  0.3   3248   788 pts/2    S+   07:01   0:00 grep --color=auto syn

« Последнее редактирование: 29 Марта 2011, 11:23:10 от neonshark »


Оффлайн
Shtsh

У тебя запущена установка. Если ты уверен, что она застопорилась и просто глючит, то делай так (ОСТОРОЖНО, ОПАСНО):

Делаешь
sudo kill 13346 13351 13374 5180
Если не убьёт, то сделай с ключом -9

sudo kill -9 13346 13351 13374 5180
(в этом случае, возможно, придётся удалить /var/lib/dpkg/lock)

Затем sudo apt-get install -f

Возможно, потребуется сделать sudo dpkg —configure


Оффлайн
neonshark

У тебя запущена установка. Если ты уверен, что она застопорилась и просто глючит, то делай так (ОСТОРОЖНО, ОПАСНО):

Делаешь
sudo kill 13346 13351 13374 5180
Если не убьёт, то сделай с ключом -9

sudo kill -9 13346 13351 13374 5180
(в этом случае, возможно, придётся удалить /var/lib/dpkg/lock)

Затем sudo apt-get install -f

Возможно, потребуется сделать sudo dpkg —configure

Спасибо огромное (!!!!), процессы убились без SIGKILL. :)

Дальше буду разбираться!


  • Печать

Страницы: [1]   Вверх

1 answer to this question.

First run:

lsof /var/lib/dpkg/lock

Then make sure that process isn’t running:

ps cax | grep PID

If it is running:

kill PID
#wait
kill -9 PID

Make sure process is done:

ps cax | grep PID

Then remove the lock file:

sudo rm /var/lib/dpkg/lock

Run an update:

sudo apt-get update

Let dpkg fix itself:

sudo dpkg --configure -a

You should be fine afterwards :)






answered

Aug 27, 2019


by



• 59,210 points



Related Questions In Linux Administration

  • All categories

  • ChatGPT
    (2)

  • Apache Kafka
    (84)

  • Apache Spark
    (596)

  • Azure
    (131)

  • Big Data Hadoop
    (1,907)

  • Blockchain
    (1,673)

  • C#
    (141)

  • C++
    (271)

  • Career Counselling
    (1,060)

  • Cloud Computing
    (3,446)

  • Cyber Security & Ethical Hacking
    (147)

  • Data Analytics
    (1,266)

  • Database
    (855)

  • Data Science
    (75)

  • DevOps & Agile
    (3,575)

  • Digital Marketing
    (111)

  • Events & Trending Topics
    (28)

  • IoT (Internet of Things)
    (387)

  • Java
    (1,247)

  • Kotlin
    (8)

  • Linux Administration
    (389)

  • Machine Learning
    (337)

  • MicroStrategy
    (6)

  • PMP
    (423)

  • Power BI
    (516)

  • Python
    (3,188)

  • RPA
    (650)

  • SalesForce
    (92)

  • Selenium
    (1,569)

  • Software Testing
    (56)

  • Tableau
    (608)

  • Talend
    (73)

  • TypeSript
    (124)

  • Web Development
    (3,002)

  • Ask us Anything!
    (66)

  • Others
    (1,929)

  • Mobile Development
    (263)

Subscribe to our Newsletter, and get personalized recommendations.

Already have an account? Sign in.

Moved from Azure/azure-linux-extensions#291.

Hi,

I am deploying an ARM template (you can find it here) with a custom linux extension (you can find it here).
This extension is basically doing some apt-get install and then manually installing a package with dpkg.

The VM this extension is attached to is based on a custom image (generalized from Ubuntu 16.04).

The extension will fail on dpkg, with error:
dpkg: error: dpkg status database is locked by another process

  • handler.log
  • waagent.log

It’s worth noting that while apt-get install seems to work fine, it also complains similarily:
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?

I did not install any other extensions.

I added a ps ax | grep dpkg in the script to see if something else was using dpkg, but it doesn’t seems so.

If I add a sleep 10m at the start of my script everything works fine, so it seems that my custom extension is executed before the VM is fully ready.

Content of /var/lib/waagent for reference

884D28C1001CCA04E6DC7D86D49DDC11C806C6CB.crt  GoalState.2.xml                                         TransportPrivate.pem
884D28C1001CCA04E6DC7D86D49DDC11C806C6CB.prv  HostingEnvironmentConfig.xml                            WireServerEndpoint
Certificates.p7m                              Incarnation                                             custom-script
Certificates.pem                              Microsoft.Azure.Extensions.CustomScript-2.0.2           events
Certificates.xml                              Microsoft.Azure.Extensions.CustomScript.2.manifest.xml  handler_state
ExtensionsConfig.1.xml                        Microsoft.Azure.Extensions__CustomScript__2.0.2.zip     ovf-env.xml
ExtensionsConfig.2.xml                        SharedConfig.xml                                        provisioned
GoalState.1.xml                               TransportCert.pem

Thanks

In this article we are going to learn ‘Fix dpkg: error: dpkg frontend lock is locked by another process’. Whenever we are installing software, an error occurs with ‘dpkg: error: dpkg frontend lock is locked by another process’. dpkg is a free operating system software at the bottom of the package management system in Debian and its numerous derivatives. dpkg is used to install, remove, and supply information about .deb packages.

The dpkg (Debian package) itself is a low-level tool. APT (Advanced Package Tool), a high-level tool, is more commonly used than dpkg because it can bring packages to remote locations and deal with complex package relationships such as dependency fixes. Frontends like Aptitude (NCRS) and Synaptic (GTK +) are used for their friendly interface for APT.

The Debian package “dpkg” provides the dpkg program, as well as many other programs required for the run-time operation of the packaging system, including DPKG-DEB, DPKG-Split, DPKG-Query, DPKG-Statoveride, DPKG-Diverse, and DPKG. Trigger.

This includes programs like Update-Option and Start-Stop-Demon. The install-info was used to include the program as well but was later removed because it has now been developed and distributed separately. The Debian package “DPKG-Dev” contains the numerous build tools described below.

Follow the below steps to Fix DPKG: Error: DPKG Frontend Lock is Locked By Another Process

If you find the “dpkg: error: dpkg frontend lock is locked by another process” error while running the procedure described above, you need to do an extra step. First, find the ID of the process that contains the lock file. You can do so using below command.

[email protected]:~$ lsof /var/lib/dpkg/lock

Then make sure the process is not running.

[email protected]:~$ ps cax | grep PID
PID TTY STAT TIME COMMAND

The above command will give you the process PID using lock files. Use this PID to kill the process.

[email protected]:~$ kill PID
bash: kill: PID: arguments must be process or job IDs

[email protected]:~$ kill -9 PID
bash: kill: PID: arguments must be process or job IDs

Also Read – A Guide to Kill, Pkill and Killall Commands to Stop the Process in Linux(Kill Process Linux)

That’s all, In this article, we have explained the Fix dpkg: error: dpkg frontend lock is locked by another process. I hope you enjoy this article. If you like this article, then just share it. If you have any questions about this article, please comment.

ITSmarttricks Team

This is Mangesh Dhulap the Founder and Editor of IT SMART TRICKS have 6+ years of Industrial Experience. We expect from our visitors to like, share, and comment on our posts.

Мне просто интересно, может кто-нибудь сказать мне, что это значит:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
reidsr@ubuntu:~$ sudo dpkg --configure -a
dpkg: error: dpkg status database is locked by another process
reidsr@ubuntu:~$ 

Как мне запустить sudo dpkg --configure -a вручную?

задан
17 July 2015 в 14:20

поделиться

10 ответов

Первый запуск:

lsof /var/lib/dpkg/lock

Затем убедитесь, что процесс не запущен:

ps cax | grep PID

Если запущен:

kill PID
#wait
kill -9 PID

Убедитесь, что процесс завершен:

ps cax | grep PID

Затем удалите файл блокировки:

sudo rm /var/lib/dpkg/lock

Дайте самому dpkg исправить:

sudo dpkg --configure -a

После этого у вас все будет хорошо:) [ 1112]

ответ дан Pooyan Khosravi
17 July 2015 в 14:20

поделиться

Это может произойти, если процесс обновления был прерван (как будто ваше соединение было потеряно). Вы можете попробовать использовать screen в качестве root (sudo su), чтобы вернуться в сессию.

screen -r

ответ дан Xeoncross
17 July 2015 в 14:20

поделиться

Вы не можете запускать несколько пакетов приложений / команд / инструментов одновременно. Иногда это означает, что в фоновом режиме работают synaptic, apt-get или инструмент обновления пакетов. Просто закройте другие инструменты пакета или дождитесь их завершения. И dpkg будет работать.

ответ дан ttoine
17 July 2015 в 14:20

поделиться

Можно также попробовать:

sudo apt-get install -f

Исправить все поврежденные пакеты:

Исправить; попытаться исправить систему с нарушенными зависимостями. Эта опция, когда используется с установкой / удалением, может пропустить любые пакеты, чтобы позволить APT вывести вероятное решение. Если указаны пакеты, они должны полностью устранить проблему. Эта опция иногда необходима при первом запуске APT; Сам APT не позволяет существующим в системе нарушенным зависимостям пакетов. Вполне возможно, что структура зависимости системы может быть настолько повреждена, что потребует ручного вмешательства (что обычно означает использование dselect(1) или dpkg --remove для устранения некоторых пакетов-нарушителей). Использование этой опции вместе с -m может привести к ошибке в некоторых ситуациях. Элемент конфигурации: APT :: Get :: Fix-Broken.

ответ дан blade19899
17 July 2015 в 14:20

поделиться

Следующее должно помочь:

sudo rm /var/lib/dpkg/lock

sudo dpkg --configure -a

ответ дан Deepak Singhvi
17 July 2015 в 14:20

поделиться

Один подход должен только перезапустить ПК. Это работало на меня.

ответ дан Eliah Kagan
16 October 2019 в 16:11

поделиться

Существуют некоторые хорошие ответы здесь, но просто требуемый для добавления non-lsof метода нахождения, что dpkg блокируют пользователя

Шаг 1: Узнайте, кто блокирует dpkg:

Опция № 1: Используя lsof (не всегда устанавливаемый на машине)

lsof /var/lib/dpkg/lock

Опция № 2: Используя удар

for pid in $(ls /proc | egrep [0-9]+); do sudo ls -l /proc/$pid/fd 2>/dev/null | grep /var/lib/dpkg/lock && echo $pid; done

Шаг 2: Решите то, что Вы хотите сделать с текущим dpkg пользователем

, Если нет такого процесса, нет ничего, чтобы решить, просто пропустить к следующему шагу.

Иначе, необходимо решить, хотите ли Вы уничтожить процесс или позволить ему закончиться корректно. Если Вы решаете уничтожить его, просто используйте kill <pid>. Если процесс все еще не умрет, можно рассмотреть уничтожение его с помощью kill -9 <pid>, но он мог бы создать определенные несоответствия, и я отговариваю от него, если Вы не знаете то, что Вы делаете.

Шаг 3: Удалите Шаг 4 файла

sudo rm /var/lib/dpkg/lock

блокировки: Зафиксируйте dpkg внутреннее состояние

sudo dpkg --configure -a

ответ дан Daniel Trugman
16 October 2019 в 16:11

поделиться

В нашем случае не было никакого рабочего процесса (PID) так я трудно остановлен и не перезагрузил VPS.

Затем, существует несколько файлов блокировки, которые, возможно, должны были бы быть удалены:

sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/cache/apt/archives/lock

Затем можно зафиксировать dpkg, как предложено:

sudo apt update
sudo dpkg --configure -a

ответ дан jessuppi
16 October 2019 в 16:11

поделиться

Одна вещь, о которой не упоминалось, — вы могли включить автоматическое / автоматическое обновление. В таком случае unattended-upgr , вероятно, удерживает блокировку dpkg. В этом случае принудительное удаление файла блокировки НЕ — хорошая идея!

Вы можете проверить, работает ли он, используя следующее:

ps -A | grep unattended-upgr

Вы также можете увидеть, удерживает ли этот процесс блокировку, используя шаг 1 ответа Дэниела Тругмана. Вариант № 2 (с использованием bash) был единственным, который показал мне PID, который заблокировал файл, и указал мне на unattended-upgr.

Насколько я знаю, у вас есть только два варианта: терпеливо дождаться завершения обновлений или временно отключить автоматические / автоматические обновления, установить необходимый пакет и снова включить его.

ответ дан Joe the Coder
23 April 2020 в 16:51

поделиться

Ни один ответ в этой теме не помог мне решить эту проблему. Я удалил файлы блокировки, и PID не работал, но всякий раз, когда я выполнял sudo dpkg --configure -a , оболочка зависала на одной из ранее заблокированных задач «apt», которые у меня были. принудительное закрытие путем закрытия терминала в конце.
Я также убил процессы apt, используя sudo killall apt apt-get. Застрявшая apt-задача в моем случае была «Настройка docker-ce (5:20.10.1~3-0~ubuntu-bionic)».

Решение в моем случае:

  • Загрузиться в режиме восстановления.
  • В меню восстановления выберите «root», чтобы «Перейти к корневой оболочке».
  • Нажмите Enter.
  • Введите «sudo dpkg —configure -a».
  • Продолжайте делать то, что вы собирались сделать, теперь это должно работать и/или просто перезагрузиться.

Пожалуйста, посмотрите скриншоты и подробное объяснение (например, как получить режим восстановления при запуске) в ответе docker ps застрял… docker install также просто зависает.

ответ дан questionto42
29 December 2020 в 15:10

поделиться

Другие вопросы по тегам:

Похожие вопросы:

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Dpkg error 1 expected program not found in path or not executable
  • Dpkg deb error subprocess tar returned error exit status 2
  • Dpkg deb error subprocess decompress returned error exit status 2
  • Dpkg deb error need an action option
  • Dpkg deb error is not a debian format archive

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии