You are not logged in.
It might seem a copy of this post https://bbs.archlinux.org/viewtopic.php?id=262303.
But my problem is a bit different. I deleted the cache of pacman as well. For that, I deleted the /var/cache/pacman directory.
Then I got this message when ever I was trying to use pacman:
```bash
$ sudo pacman -Sy
error: failed to initialize alpm library:
(root: /, dbpath: /var/lib/pacman/)
could not find or read directory
```
Then I recreated the /var/lib/pacman folder with this command `sudo mkdir /var/lib/pacman`.
Then It did update pacman but, If I do `pacman -Q` that does not list any packages.
After that I thought that I will install sway (I already have it) and it tried to install it and didn't even show the -- reinstalling text.
And after it finishes installing it just gives a lot of messages saying that some file or directory already exists.
I don't know what to do.
So please help!
Thanks.
Offline
Follow the link I linked for instructions on how to restore the pacman database: https://wiki.archlinux.org/title/Pacman … l_database
You can basically "ignore" the cache matching helper script and just rely on the output the paclog command gives you.
Future note, pacman has the -Sc and -Scc command line switch that will safely and correctly clean out the cache, see also https://wiki.archlinux.org/title/Pacman … kage_cache for some other options.
Last edited by V1del (2023-08-11 09:12:18)
Offline
You could try this https://wiki.archlinux.org/title/Pacman … l_database
Offline
The link provided by V1del, told me to install the pacutils package to get paclog. I installed it with this command: sudo pacman -S pacutils. And this is my output:
pacman: /usr/share/man/man3/libalpm_packages.3.gz exists in filesystem
pacman: /usr/share/man/man3/libalpm_sig.3.gz exists in filesystem
pacman: /usr/share/man/man3/libalpm_trans.3.gz exists in filesystem
pacman: /usr/share/man/man5/BUILDINFO.5.gz exists in filesystem
pacman: /usr/share/man/man5/PKGBUILD.5.gz exists in filesystem
pacman: /usr/share/man/man5/alpm-hooks.5.gz exists in filesystem
pacman: /usr/share/man/man5/makepkg.conf.5.gz exists in filesystem
pacman: /usr/share/man/man5/pacman-hooks.5.gz exists in filesystem
pacman: /usr/share/man/man5/pacman.conf.5.gz exists in filesystem
pacman: /usr/share/man/man8/makepkg.8.gz exists in filesystem
pacman: /usr/share/man/man8/pacman-conf.8.gz exists in filesystem
pacman: /usr/share/man/man8/pacman-key.8.gz exists in filesystem
pacman: /usr/share/man/man8/pacman.8.gz exists in filesystem
pacman: /usr/share/man/man8/repo-add.8.gz exists in filesystem
pacman: /usr/share/man/man8/repo-remove.8.gz exists in filesystem
pacman: /usr/share/man/man8/vercmp.8.gz exists in filesystem
pacman: /usr/share/pacman/PKGBUILD-split.proto exists in filesystem
pacman: /usr/share/pacman/PKGBUILD-vcs.proto exists in filesystem
pacman: /usr/share/pacman/PKGBUILD.proto exists in filesystem
pacman: /usr/share/pacman/proto.install exists in filesystem
pacman: /usr/share/pkgconfig/libmakepkg.pc exists in filesystem
pacman: /usr/share/zsh/site-functions/_pacman exists in filesystem
Errors occurred, no packages were upgraded.That exists in filesystem line continues for a long while. And alacritty can't even load them all.
And As you can see the last line says 'Errors occurred, no packages were upgraded.' that means pacutils did not install.
What do i do?
Offline
As the pacman's databases were removed I would suggest using the assume-installed option so pacman adds that dependency for this transaction:
# pacman -S --assume-installed=pacman=6.0.2-7An alternative would be skipping dependency checks which normally you should never do but the only dependency is pacman and it can not be resolved with the broken databases:
# pacman -Sdd pacutilsOffline
I think I have to reinstall arch linux as things are not working as it did before.
Offline
Offline