Normally I update my system when there is a notification about updates. But for some time I did not get any notification. Firefox was stuck at 105 version and so was KDE plasma at 5.25.x. I was curious and ran sudo pacman -Syu
and got an error, error: failed to synchronize all databases. If you have the encountered the same error, read on how to fix it easily on your Manjaro system.
Before running some commands, let me share the exact error message.
error: failed to synchronize all databases (no servers configured for repository)
Upon investigating, I found that my mirrors file is empty. It was Strange.
cat /etc/pacman.d/mirrorlist
To fix that, it is recommended to run the following command 1st.
sudo pacman-mirrors -f
This will filter all the mirrors and update /etc/pacman.d/mirrorlist
based on the ping to the server, which could be also the nearest zone to you.
Now check again if the mirrors are updated.
cat /etc/pacman.d/mirrorlist
Now you can safely run the update command.
sudo pacman -Syu
Clear cache?
That’s not required, but if you would like to do that. Run the following command.
sudo pacman -Scc
Dependency issue?
If you get a dependency issue for a package, you can remove that package and install it later on.
sudo pacman -R PACKAGE_NAME
If you are still stuck somewhere, checkout the Manjaro forum.
- AlexGanter
- ↑
- ↓
-
29 февраля 2020, 16:57
sudo rm /var/lib/pacman/db.lck
И попробуйте обновить.
А эта команда удаляет неисправные базы данных:
sudo rm -f /var/lib/pacman/sync/*
Последний раз редактировалось 29 февраля 2020, 17:00
- AlexGanter
- ↑
- ↓
-
29 февраля 2020, 18:36
У вас точно проблема с интернетом, так как опять пишет об истечении времени, доступности серверов.
Возьмите мой рабочий mirrorlist, скопируйте с заменой в /etc/pacman.d/ и попробуйте обновить.
Последний раз редактировалось 29 февраля 2020, 18:43
- автор gitineg859
- ↑
- ↓
-
29 февраля 2020, 18:50
Странно, ведь даже на заднем фоне видно, что сайт форума вполне загрузился c нормальной скоростью. Даже команда ping, на недоступные сервера показывает, что соединение есть.Раньше ставил Manjaro, всё было нормально. Но теперь такие вот проблемы. Видно придётся остаться на Ubuntu. Спасибо за помощь)
Последний раз редактировалось 29 февраля 2020, 18:51
- AlexGanter
- ↑
- ↓
-
29 февраля 2020, 18:56
Так вы в реале попробуйте загрузится с флэшки, в кривых настройках сети виртуалки манжаро не виновата)
В реальности всё работает.
Последний раз редактировалось 29 февраля 2020, 18:57
- автор gitineg859
- ↑
- ↓
-
29 февраля 2020, 19:05
Так говорил ведь, грузился и в реале с флешки, и с виртуалки. Также ставил на жд, ошибки те же… Даже пробывал несколько устройств, мало ли, но ошибка та же. Месяц назад скачивал 18 версу, поставил и впервые столкнулся с этой проблемой, тогда я забил, подумав что образ битый, снова поставив ubuntu. Скачал вот, недавно 19, но проблема не ушла.
- AlexGanter
- ↑
- ↓
-
29 февраля 2020, 19:24
У вас же KDE.
Для root доступа сделайте:
Завершить сеанс->Сменить пользователя(справа иконка).
Пользователь:
root
вводите пароль
Последний раз редактировалось 29 февраля 2020, 19:25
- автор gitineg859
- ↑
- ↓
-
29 февраля 2020, 20:04
Верно, кеды ставил. Попробывал кинуть файлы, которые вы давали и всё заработало) Спасибо за помощь! Забавно, что изначально этих файлов не было
Ошибка 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.
Источник
Loading
To start Code and Compile C++, must install a compiler. For my case, it is MSYS2 through which MinGW is available. According to the installation guild mentioned on the website, I installed the software without any errors. Now I was supposed to update the package database and base packages by entering pacman -Sys
but it has shown an error
error: failed to synchronize all databases (unable to lock database)
After searching online for a solution I found that deleting/removing the db.lck
will work, for that, I used this command rm /var/lib/pacman/db.lck
but it showed another error. Right now there is no solution to this on the internet.
I’ve also pasted the terminal output of MSYS2 MSYS for refernce.
$ pacman -Sys
:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)
VIRAT@DESKTOP-97BS0AB MSYS ~
$ rm /var/lib/pacman/db.lck
rm: cannot remove '/var/lib/pacman/db.lck': No such file or directory
VIRAT@DESKTOP-97BS0AB MSYS ~
$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
VIRAT@DESKTOP-97BS0AB MSYS ~
$ pacman -Su
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
VIRAT@DESKTOP-97BS0AB MSYS ~
$