Ошибка failed to synchronize all databases не удалось заблокировать базу данных

Недавно столкнулся с проблемой обновления софта на Manjaro
Уголок новичка: Проблема с обновлением Manjaro, не удалось заблокировать базу данных, не удалось синхронизировать базы данных
Прочитал много интернета, попробовал много решений, но ничего не помогло.
Сначала все делал, как здесь.
Не помогло, потом шаманил и с mirrorlist, и с /etc/pacman.conf, тоже не дало результатов.
Но самое странное, что при попытке установить ArchLinux с загрузочной флешки через archinstaller, то в самом начале выдает ошибку при проверке archlinux-keyring.
Пытался вручную установить, но тоже не помогло

Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.

#
9 лет, 7 месяцев назад

Vadim avatar

Темы:

308

Сообщения:

2056

Участник с: 20 ноября 2013

При вводе команды #pacman -Syu появилось такое сообщение

  • :: Синхронизируются базы данных пакетов…
    ошибка: не удалось обновить core (не удалось заблокировать базу данных)
    ошибка: не удалось обновить extra (не удалось заблокировать базу данных)
    ошибка: не удалось обновить community (не удалось заблокировать базу данных)
    ошибка: не удалось синхронизировать ни одну базу данных
    ошибка: не удалось начать запрос (не удалось заблокировать базу данных)
    ошибка: не удалось заблокировать базу: Файл существует
    если вы уверены, что pacman не запущен, можете
    удалить /var/lib/pacman/db.lck

Позавчера обновлял было всё нормально,сегодня попробовал такая беда.В Arch совсем недавно,что посоветуете,удалить как просит /var/lib/pacman/db.lck ,это не опасно?И отчего такая ошибка могла появиться?

Linux Forever!

lampslave

#
9 лет, 7 месяцев назад

Темы:

32

Сообщения:

4800

Участник с: 05 июля 2011

В другой консоли pacman не запущен?

Vadim

#
9 лет, 7 месяцев назад

Vadim avatar

Темы:

308

Сообщения:

2056

Участник с: 20 ноября 2013

Нет,только включил компьютер и ничего вообще не запускал.

Linux Forever!

lampslave

#
9 лет, 7 месяцев назад

Темы:

32

Сообщения:

4800

Участник с: 05 июля 2011

Тогда сносите файл и обновляйтесь.

Vadim

#
9 лет, 7 месяцев назад

Vadim avatar

Темы:

308

Сообщения:

2056

Участник с: 20 ноября 2013

lampslave ,спасибо,сделал #rm -r /var/lib/pacman/db.lck и после этого обновление прошло как по маслу.

Linux Forever!

lampslave

#
9 лет, 7 месяцев назад

Темы:

32

Сообщения:

4800

Участник с: 05 июля 2011

Так и должно быть. Скорее всего в прошлый раз pacman убился, а не завершился нормально, вот блокировка и осталась.

Ошибка error: failed to synchronize all databases (unable to lock database) (РЕШЕНО)

При попытке обновить Arch Linux или дистрибутив на его основе (например, BlackArch) может возникнуть ошибка «error: failed to synchronize all databases (unable to lock database)».

Например, при вводе команды

Может быть выведено (в случае, если система с английской локалью):

С русской локалью будет написано «ошибка: failed to synchronize all databases (не удалось заблокировать базу данных)», то есть ошибка синхронизации всех баз данных из-за того, что не получилось заблокировать базу данных.

Это означает, что создан файл, который говорит о том, что база данных пакетов заблокирована для работы, поскольку в настоящее время работу с базой данной пакетов ведёт другая программа.

Если это действительно так (например, вы уже запустили pacman в другой вкладке), то рекомендуется дождаться выполнения этой команды, чтобы впоследствии не возникло ошибок в кэше и базе данных установленных пакетов.

Если вы уверены, что это сообщение выводиться исключительно по ошибке — например, вы через SSH с помощью pacman обновляли пакеты, но сессия неожиданно была прервана и вы вновь подключись к удалённому компьютеру, но при попытке использовать pacman появляется эта ошибка, то в этом случае для её исправления достаточно удалить файл /var/lib/pacman/db.lck следующим образом:

После этого вновь запустите pacman — проблема должна быть полностью решена.

Если вы не уверены, нужно ли удалять файл db.lck, то вы можете проверить дату его создания следующим образом:

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

Если проблема не решена, то второй причиной может быть переполненность диска — на нём не осталось места чтобы записать файл блокировки. В этом случае очистите диск и повторите команду для обновления системы.

Очистку можно начать с удаления журналов. Например, для удаления логов веб-сервера:

Для удаления временных файлов:

Для удаления файлов установочных пакетов:

Близкие статьи

  • Ошибка error: failed to update core (unable to lock database) (РЕШЕНО) (100%)
  • Ошибка: «файл vmlinuz-linux» не найден (РЕШЕНО) (100%)
  • Аналог опции —force в pacman (100%)
  • Ошибка pacman «warning: failed to retrieve some files» (РЕШЕНО) (100%)
  • Ошибка «ruby-bundler: /usr/share/man/man5/gemfile.5.gz exists in filesystem (owned by ruby)» (РЕШЕНО) (100%)
  • Ошибка «не удалось завершить транзакцию (неверный или поврежденный пакет)» (РЕШЕНО) (RANDOM — 100%)

1 thought on “ Ошибка error: failed to synchronize all databases (unable to lock database) (РЕШЕНО) ”

OS: EndeavourOS Linux
`:+sssssssssso/. Host: B250M-DS3H
`-/ossssssssssssso/. Kernel: 5.19.7-zen2-1
`-/+sssssssssssssssso+:` Uptime: 22 mins
`-:/+sssssssssssssssssso+/. Packages: 853 (pacman
`.://osssssssssssssssssssso++- Shell: bash 5.1.16
.://+ssssssssssssssssssssssso++: Resolution: 1680×1050
.:///ossssssssssssssssssssssssso++: WM: i3
`:////ssssssssssssssssssssssssssso+++. Theme: Adwaita [GTK2]
`-////+ssssssssssssssssssssssssssso++++- Icons: Adwaita [GTK2]
`..-+oosssssssssssssssssssssssso+++++/` Terminal: xfce4-termi
./++++++++++++++++++++++++++++++/:. Terminal Font: Source
`. ——« CPU: Intel i7-7700 (8
GPU: NVIDIA GeForce G
Memory: 1018MiB / 320

OS: EndeavourOS Linux
`:+sssssssssso/. Host: B250M-DS3H
`-/ossssssssssssso/. Kernel: 5.19.7-zen2-1
`-/+sssssssssssssssso+:` Uptime: 22 mins
`-:/+sssssssssssssssssso+/. Packages: 853 (pacman
`.://osssssssssssssssssssso++- Shell: bash 5.1.16
.://+ssssssssssssssssssssssso++: Resolution: 1680×1050
.:///ossssssssssssssssssssssssso++: WM: i3
`:////ssssssssssssssssssssssssssso+++. Theme: Adwaita [GTK2]
`-////+ssssssssssssssssssssssssssso++++- Icons: Adwaita [GTK2]
`..-+oosssssssssssssssssssssssso+++++/` Terminal: xfce4-termi
./++++++++++++++++++++++++++++++/:. Terminal Font: Source
`. ——« CPU: Intel i7-7700 (8
GPU: NVIDIA GeForce G
Memory: 1018MiB / 320

Your advice is right. My sistem is update now . Thank you for your efforts.

Источник

error: failed to synchronize all databases (unable to lock database) (SOLVED)

January 14, 2022

When trying to update Arch Linux or a distribution based on it (for example, Manjaro or BlackArch), an error “failed to synchronize all databases (unable to lock database)”» may occur.

For example, when entering the command

It can be output:

This means that a file has been created that indicates that the package database is locked for processing, because another program is currently working with the package database.

If this is indeed the case (for example, you have already started pacman in another tab), then it is recommended that you wait for this command to complete so that there are no errors in the cache and database of installed packages later.

If you are sure that this message is displayed exclusively by mistake – for example, you updated packages via SSH using pacman, but the session was unexpectedly terminated and you reconnect to the remote computer, but this error appears when you try to use pacman, then in this case for fixing it is enough to delete the file /var/lib/pacman/db.lck file as follows:

After that, run pacman again – the problem should be completely resolved.

If you are unsure whether to delete the db.lck file, you can check its creation date as follows:

The creation date can tell you why this file is present in the system.

If the problem is not solved, then the second reason may be the disk is full – there is no space left on it to write the lock file. In this case, clean the disk and retry the command to update the system.

You can start the cleanup by deleting the logs. For example, to remove web server logs:

Источник

Arch Linux

You are not logged in.

#1 2012-09-16 07:53:19

[SOLVED] pacman: «unable to lock database»

I have been working hard to install my Arch Linux as all of you have but now that i finally installed it i am trying to do some
postinstalation things located here.

I first opened /etc/pacman.conf file and at the end of the file added the repository [multilib], which pacman was
supposed to look for on my 1st mirror in /etc/pacman.d/mirrorlist which is this one.
Long story short, this is the code i added in my /etc/pacman.conf:

I saved the file but while mirror is available pacman still refuses to update mirror lists using command:

This produces the error:

I am currently logged in as root and i don’t know why is the database locked, as root was supposed to be able to do whatever he likes?
What can i do to resolve the «lock database» error?

Last edited by 71GA (2012-09-16 09:28:37)

C, ARM, ARM assembly, HTML, CSS, JS, Linux

#2 2012-09-16 08:04:53

Re: [SOLVED] pacman: «unable to lock database»

Did you try to remove the db.lck file? This happens when pacman is interrupted.

#3 2012-09-16 08:06:12

Re: [SOLVED] pacman: «unable to lock database»

Did you try to remove the db.lck file? This happens when pacman is interrupted.

Is it safe to do it?

C, ARM, ARM assembly, HTML, CSS, JS, Linux

#4 2012-09-16 08:26:39

Re: [SOLVED] pacman: «unable to lock database»

I did remove /var/lib/pacman/db.lck and again used command

And it partialy worked as it did update repositories [core] [extra] and [comunity]. After this it again reports
an error about [multilib]. This is the error which i get for every mirror listed in my /etc/pacman.d/mirrorlist file:

«404 Not Found» indicates that URL cant be found which could be an internet problem, but this can’t be the issue here
as other depositories are sucessfully installed and furthermore it could never have happend to all the mirrors at once.

Last edited by 71GA (2012-09-16 08:28:06)

Источник

Pacman troubleshooting

Содержание

Various issues relating to the download and installation of software packages from the Manjaro repositories are dealt with here.

«Unrecognized archive format» Error

It has ocurred more than once, an update is issuing these messages in a seemingly never ending stream. Pacman could not open file: sync files

The error relates to a mismatch in the information contained in the db files at the mentioned location and the db files at the first mirror in your mirrorlist. Pacman checks a package in the database and sees if the signature file matches the one in the database. If it does not, then pacman will say the package is corrupted.

While it sometimes is possible to fix the issue simply by deleting the files and the running a pacman update it far from every time.

One recipe for fixing this

It is mandatory to ensure that the keyrings is current. By ensuring the keyrings are in shape and then redownloading the databases we reestablish the chain of trust between the keyrings and the packages.

You will have to find the correct names by looking at

Replace yyyymmdd and x with the info found at the above links

Remove your faulty databases

Download the databases and update the system

«Unable to lock database» Error

When downloading and installing software from the repositories, a special database lock file will be created in order to ensure that the current installation process is the only one running at that time. Otherwise, attempting to install multiple files from multiple sources simultaneously may corrupt the downloaded files, cause file conflicts — or worse still — damage your system. Once the installation has been completed, the lock file will then be automatically deleted. This error may therefore occur due to two possible reasons:

  • Another installation is still taking place and has not yet finished, or
  • A previous installation attempt had not finished properly (e.g. due to being aborted early)

It is therefore wise to first check to ensure that another installation is not (or had not been) in process at the time of the error. When satisfied that this is not the case, then the database lock file can be manually deleted. To do so, open up the terminal and enter the following command:

Once done, you should now be able to successfully re-attempt your intended installation.

Errors about Keys

We all have our own unique signatures which are used to authenticate who we are and to prevent fraudulent or even malicious activities by others. This is also the case with software packages available from the software repositories. They all contain encrypted codes (signature keys) unique to their developers to ensure that they are authentic and not malicious in nature.

During the installation process, once any software packages have been downloaded, your system will first check their signature keys to ensure that they are authentic prior to actually installing them. If a signature key cannot be verified for any reason, then the installation process will be aborted. This problem will usually occur due to:

  • one or more signature keys contained in your system’s database being revoked, changed, corrupted, or out of date
  • one or more software packages not having been signed off properly when placed in a repository

Where a package has not been signed off properly before being placed in a repository, it will be the responsibility of the developer(s) to correct this. However, as this problem will be more than likely due to a problem with your system’s verification of a signiture key, this can be solved in three easy steps. Working net connection is required. Once you have opened your terminal:

1. Remove old (and possibly broken) keys by entering this command:

2. Reinstall keyrings including the latest keys:

3. Initialize the pacman keyring:

4. Load the signature keys:

5. Refresh and update the signature keys:

6. Clear out the software packages downloaded during the aborted installation (optional):

1. Remove old (and possibly broken) keys by entering this command:

2. Initialize the pacman keyring:

3. Download the packages:

Those running ARM may also need to download archlinuxarm-keyring and manjaro-arm-keyring.

4. Remove the signatures:

5. Install the downloaded packages manually:

6. Clear out the software packages downloaded during the aborted installation (optional):

7. Remove the custom package folder: (optional):

After that try running sudo pacman -Syu to see if the errors were resolved.

Conflicting files — FILENAME exists in filesystem

If you cant can’t install or update a package because of an error like this:

Then the package manager, pacman, has detected an unexpected file that already exists on the disk.

Why is this happening?

By design pacman will not overwrite files that already exist. This is a design feature, not a flaw — package managers are designed to keep track of installed files.

This issue normally happens because you’ve manually added, copied, or created a file. It can also happen when you install software using a downloaded executable, run a make install, or use a third-party package system such as conda. It also occurs when you install an AUR package which installs files that conflict with a repo package.

When using a third-party installer you should always specify an alternative installation location, such as under your home directory, or under /opt or /usr/local/. Never install directly under / or /usr.

How can I fix this?

The first step is to identify which, if any, package owns the file. This can be easily done with:

If this identifies a conflicting package you can decide to remove it with pacman -R. If no package is identified you can delete the file (or move it to a backup location).

Where can I read more?

This post was inspired by (and adapted from):

The above post also has links to further reading.

«Configuration file. not recognized» Error

Manjaro’s package manager — pacman — uses a file called mirrorlist to tell it the internet addresses of the Manjaro servers in order to download updates and software applications from them. This error will therefore occur if one or more server addresses contained in the mirrorlist file have not been listed properly, resulting in pacman being unable to connect to them. Another tell-tale sign is that this problem will also be encountered immediately after:

  • Installing Manjaro and editing the mirrorlist file during installation, or
  • Editing the mirrorlist file at a later time.

See the Change to a Different Download Server guide for more detailed information on how to correctly select and enable another Manjaro server for downloading.

«GPGME error: No data» Error

The most likely cause of this issue is that an error or corruption has been detected by pacman in one or more software packages being downloaded. Package signatures and checksums are used to verify the validity of downloaded software, and should they fail, the installation attempt will be aborted to protect your system until the matter is resolved.

Option 1: Basic Resolution

To resolve this issue, first follow the basic procedure provided below. If this does not work, then there is a more comprehensive procedure available.

1. Download the package databases and update your system:

2. Clear out the software packages downloaded during the aborted installation by entering the command:

3. Re-attempt the aborted download.

Option 2: Comprehensive Resolution

If the basic proceedure still does not resolve the matter, further steps are available:

1. Resynchronise with the Manjaro servers to ensure that everything is up to date by entering the command:

2. Refresh and update the signature keys by entering the command:

3. Reload the signature keys by entering the command:

4. Clear out the software packages downloaded during the aborted installation by entering the command:

5. Re-attempt the aborted download.

If the error still persists, then it is recommended to Change to a Different Download Server.

Источник


0

1

Есть 3 обновления. Выхлопы:

sudo pamac update:

Внимание: Сборка пакетов от имени динамического пользователя
Внимание: Выбор каталога сборки /var/cache/pamac
Подготовка...
Синхронизация баз данных пакетов...
не удалось заблокировать базу данных
Не удалось синхронизировать базы данных
Обновление AUR...                                                                                   
Нет заданий.                                                                                        
Транзакция успешно завершена.

sudo pamac upgrade:

Внимание: Сборка пакетов от имени динамического пользователя
Внимание: Выбор каталога сборки /var/cache/pamac
Подготовка...
Синхронизация баз данных пакетов...
не удалось заблокировать базу данных
Не удалось синхронизировать базы данных
Нет заданий.
Транзакция успешно завершена.

ЧЯДНТ?

I did an update (-Syu) this morning. After lunch, my maschine froze and I had to do a cold restart. When I checked pacman -Syu again, I got this error:

$ pacman -Syu
[sudo] password for user: 
:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to synchronize all databases

Looking at pacman:

$ ls -lah /var/lib/pacman/
total 84K
drwxr-xr-x    4 root root 4.0K Sep 12 10:08 .
drwxr-xr-x   36 root root 4.0K Sep 12 00:00 ..
----------    1 root root    0 Sep 12 10:08 db.lck
drwxr-xr-x 1394 root root  68K Sep 10 17:44 local
drwxr-xr-x    2 root root 4.0K Sep 12 10:08 sync

I am unsure what to do now. How should I proceed to solve this issue?
Thank you for your help.

Last edited by jared (2019-09-12 12:17:12)

  • Ошибка failed to synchronize all databases не настроены сервера для репозитория
  • Ошибка failed to start the game cannot find essential information in the registry
  • Ошибка failed to start precomp exe
  • Ошибка failed to start denuvo driver error code 2148204812
  • Ошибка failed to set display mode