Manjaro is failing to update due to a missing file or folder

Recently, I had fixed my broken kernels thanks to this forum. Before that, I may have been running commands that may or may not have helped fix the kernels and I’m not sure if that is the perpetrator.

When I run sudo pacman -Syyu its output is:

:: Synchronizing package databases...
 core                  164.9 KiB  4.03 MiB/s 00:00 [######################] 100%
 extra                1996.3 KiB  6.17 MiB/s 00:00 [######################] 100%
 community               6.6 MiB  6.12 MiB/s 00:01 [######################] 100%
 multilib              180.5 KiB  6.53 MiB/s 00:00 [######################] 100%
 sublime-text         1827.0   B  0.00   B/s 00:00 [######################] 100%
 sublime-text.sig      542.0   B  0.00   B/s 00:00 [######################] 100%
:: Starting full system upgrade...
error: could not open file /var/lib/pacman/local/linux510-headers-5.10.19-1/desc: No such file or directory
resolving dependencies...
looking for conflicting packages...
warning: could not fully load metadata for package linux510-headers-5.10.19-1
error: failed to prepare transaction (invalid or corrupted package)

I’m unsure why its looking for the linux510-headers and more unsure why it cannot find it?

Thank you for your time

Here is the description of linux510-headers:

Repositorium             : core
Name                     : linux510-headers
Version                  : 5.10.23-1
Beschreibung             : Header files and scripts for building modules for
                           Linux510 kernel
Architektur              : x86_64
URL                      : http://www.kernel.org/
Lizenzen                 : GPL2
Gruppen                  : Nichts
Stellt bereit            : linux-headers=5.10.23
Hängt ab von             : gawk  python  libelf
Optionale Abhängigkeiten : Nichts
In Konflikt mit          : Nichts
Ersetzt                  : Nichts
Größe des Downloads      : 9,46 MiB
Installationsgröße       : 47,73 MiB
Packer                   : Helmut Stult <helmut@manjaro.org>
Erstellt am              : Do 11 Mär 2021 19:46:40 CET
Verifiziert durch        : MD5-Summe  SHA-256-Summe  Signatur

Try reinstalling it sudo pacman -S linux510-headers and see if the update goes through afterwards.

See this post from the archived Forum:
https://archived.forum.manjaro.org/t/error-could-not-open-file-var-lib-pacman-local-desc-files-mtree-no-such-file-or-directory/84804

In your case the command to use in a terminal window is:

sudo touch /var/lib/pacman/local/linux510-headers-5.10.19-1/desc

After that proceed with the system update.

1 Like
sudo pacman -S linux510-headers
resolving dependencies...
looking for conflicting packages...
error: could not open file /var/lib/pacman/local/linux510-headers-5.10.19-1/files: No such file or directory
warning: could not fully load metadata for package linux510-headers-5.10.19-1
error: failed to prepare transaction (invalid or corrupted package)

I don’t know why its trying to update after im trying to install something

Do the same for this file too:

sudo touch /var/lib/pacman/local/linux510-headers-5.10.19-1/files

The same applies in case you get a similar error for the file /var/lib/pacman/local/linux510-headers-5.10.19-1/mtree (see the thread I linked in my previous post).

Then try to update your system again.

2 Likes

It was updating but then this happened:

error: failed to commit transaction (conflicting files)
linux510: /boot/linux510-x86_64.kver exists in filesystem
linux510: /usr/lib/modules/extramodules-5.10-MANJARO/version exists in filesystem
Errors occurred, no packages were upgraded.

Please read this:

3 Likes

Sorry for wasting your time but I’m still not sure what to do?

In a nutshell, what you will have to do is:

sudo pacman -S linux510-headers --overwrite '*'

After that, you can try the update again:

sudo pacman-mirrors --fasttrack && sudo pacman -Syyu

I think /boot/linux510-x86_64.kver belongs to the linux510 package, but I might be wrong. Maybe /usr/lib/modules/extramodules-5.10-MANJARO/version as well.

Indeed, it looks like @gnoblin_44 might have more errors in pacman database. So, it might make sense to let it overwrite all files:

sudo pacman-mirrors --fasttrack && sudo pacman -Syyu  --overwrite '*'

I never tried to force-overwrite a whole update, so I’m not sure if that’s recommendable…

Thank you for the response but after running the command you gave me, I tried to update the system again and it did this again

error: failed to commit transaction (conflicting files)
linux510: /boot/linux510-x86_64.kver exists in filesystem
linux510: /usr/lib/modules/extramodules-5.10-MANJARO/version exists in filesystem

Same with: sudo pacman -Syyu --overwrite '*'

I always have the worst luck when it comes to linux and programming, always takes me a long to set up or fix something

Strange as --overwrite '*' should, as it says, overwrite the offending files.
But as it looks like you have only two of them, just do

sudo rm /boot/linux510-x86_64.kver
sudo rm /usr/lib/modules/extramodules-5.10-MANJARO/version
sudo pacman -Syyu

Or before deleting files try:
sudo pacman -S linux510 --overwrite /usr/lib/modules/extramodules-5.10-MANJARO/version,/boot/linux510-x86_64.kver

This happened:

(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
error: failed to commit transaction (conflicting files)
linux510: /boot/linux510-x86_64.kver exists in filesystem
linux510: /usr/lib/modules/extramodules-5.10-MANJARO/version exists in filesystem
Errors occurred, no packages were upgraded.

I’ll try tomorrow as its getting late where I am

After which command?

Your command