[SOLVED] Deleted “/var/lib/pacman/” [by reinstalling]

So I'm in a self-made hell, Pacman was locked in the “Waiting for another package manager to quit…" thing so I went to delete "db.lck" as I usually did when his happened but I deleted the entire folder. I understand my stupidity and my poor use of Sudo power, but now I'm completely in the dark. I know next to nothing about Linux or in general about terminals except one thing or other so I usually avoid it. Until now I tried

Sudo pacman -Syu

Sudo pacman -Syuu

Sudo pacman -Syy

and of these gave the same “Cannot find directory: /var/lib/pacman”, then I added the folder with mkdir and now the error rest in “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 update multilib-testing (unable to lock database)

error: failed to synchronize any databases”

With the exception from “Sudo pacman -Syy” that worked once and not anymore. In the pamac visual when I try to install something this happens

“Sincronizando banco de dados de pacotes...

Updating core.db...

Atualizando extra.db...

Atualizando community.db...

Atualizando multilib.db...

Atualizando core.files...

Atualizando extra.files...

Atualizando community.files...

Atualizando multilib.files…” and then “desktop-file-utils: /usr/share/man/man1/update-desktop-database.1.gz already exists in files system” for hundreds of files. I don’t know what to do anymore, really dont. Please help me and be kind.

no way for you :

  • /var/lib/pacman/sync
    no problem, is the repo database (re-create with pacman -Syu) - all packages in repos

  • /var/lib/pacman/local
    it's the local database, for pacman all installed packages
    empty for you - so for pacman , you have no package installed


you can install some with the "override" option but it is impossible for you to know which packages you had explecitly installed before


ps: exist a list for the original iso in gitlab "iso_name/Packages-Desktop"

you can get, modify in kate and after inject file in pacman

curl -s "https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/raw/master/manjaro/kde/Packages-Desktop" | grep -v "^#"

but none of the packages you installed after the iso will be in this list so the database will still be wrong

1 Like

Have you considered re-installing?
Back up your important stuff and bite the bullet.
Might be easier than trying to piece back together pacman.

1 Like

Time to speak about backup, mhhhhh, not today :wink:

3 Likes

I was afraid it was that bad :frowning:. I'm do this every now and then, ■■■■ everything in my OS and have to do a clean install. Gotta learn with my mistakes.

Gonna do a clean install tomorrow morning, thank you guys very much for the help.

1 Like

No time, no space for backups, use

Hi, I could only do this if I had a healthy list already, right?! If not, how can I run the hook? I alrealdy created both the Timeshift and the List hooks but I don't know what to do next. I tried to install a random software and update the mirrors list but that didn't fly.

Yes, for future.

If correct installed, it start automatically by pacman {install, remove,upgrade}

[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Operation = Remove
Target = *

:man_shrugging:

I use 5 .hook, all work, include 50-pacman-list.hook.
timeshift.hook I do not need, but I am sure it work too.
Ask in tbg thread.

1 Like

Did you reinstall or are you being stubborn? :wink:

1 Like

Both, I guess. :wink:

1 Like

I was delaying the inevitable :frowning:. Gonna do it now. Keep you guys updated.

1 Like

Ok, did it and now I have a working Pacman, gonna make all the hooks again now. Thank you, guys :heart:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by