You are not logged in.

#1 2021-01-03 19:19:17

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Deleted /var/lib/pacman by accident

I was trying to delete the db.lck file but I deleted the entire directory by accident.

Total newbie here, what should I do? Help!!

Offline

#2 2021-01-03 19:28:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: Deleted /var/lib/pacman by accident

https://wiki.archlinux.org/index.php/Pa … l_database

What did you try to remove the lock file for in the first place? It's there for a reason and I can't imagine many legitimate scenarios for why you'd want to try to do that in the first place.

Offline

#3 2021-01-03 19:33:13

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

Because I couldn't updated it. Read this a while ago: https://ostechnix.com/how-to-fix-unable … rch-linux/

How can I install pacutils without pacman?

Offline

#4 2021-01-03 19:41:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: Deleted /var/lib/pacman by accident

If you really just deleted that directory you only deleted the database, nothing should stop you from installing packages. If something stops you, post the error messages

Offline

#5 2021-01-03 19:43:03

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

The error says: could not find or read directory: /var/lib/pacman

Offline

#6 2021-01-03 19:43:57

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

I deleted the entire directory, not just "local"

Offline

#7 2021-01-03 19:48:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: Deleted /var/lib/pacman by accident

Well, create the directory?

Once the directory is there again, an -Sy will refresh the db and allow you to install pacutils.

Last edited by V1del (2021-01-03 19:49:48)

Offline

#8 2021-01-03 19:55:28

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

Oh thanks! But now I have to do the instructions from the link you shared, but I can't install pacutils either it says "exists in the filesystem" for every package it tries to update/download and then the message: Errors occurred, no packages were upgraded.

Offline

#9 2021-01-03 19:58:56

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

Maybe It was because I did the following?

Downloaded pacman at https://sources.archlinux.org/other/pacman/.

$ ./configure
$ make
# make install

Offline

#10 2021-01-03 20:00:15

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: Deleted /var/lib/pacman by accident

If pacutils is already installed you do not need to reinstall it to fix the issue.

Why did you install pacman from source?

Offline

#11 2021-01-03 20:01:52

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

Because I didn't know what to do... I thought I deleted it all

Offline

#12 2021-01-03 20:04:42

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

pacutils is not installed

Offline

#13 2021-01-03 20:05:53

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: Deleted /var/lib/pacman by accident

Uninstall the source built pacman,  hopefully it supports the following

# make uninstall

then follow the instructions from V1del's link.

Offline

#14 2021-01-03 20:06:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: Deleted /var/lib/pacman by accident

As an additional argument    --overwrite "*" or -dd to ignore the dep checks as the dependencies are likely there for other cases anyway, in order to install pacutils

Offline

#15 2021-01-03 20:07:41

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: Deleted /var/lib/pacman by accident

Install pacutils skipping dependency checking which is broken with the empty pacman database

# pacman -Sdd pacutils

Offline

#16 2021-01-03 20:27:29

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

I'm geting this error now:

[skywalker@Tesla ~]$ sudo pacman "$@" --log /dev/null --noscriptlet --dbonly --overwrite "*" --nodeps --needed -S $(< pkglist)
error: no targets specified (use -h for help)
[skywalker@Tesla ~]$ recovery-pacman
bash: recovery-pacman: command not found

I pasted the bash funciton in .bashrc but it doesn't seem to work

Offline

#17 2021-01-03 20:40:58

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Re: Deleted /var/lib/pacman by accident

I pasted the bash funciton in .bashrc

Did you re-source the  bashrc?

I'm geting this error now:

Looks like the file "pkglist" is empty.

Offline

#18 2021-01-03 22:37:49

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

Thank you all!! It worked like a charm.

I'm curious... What happens with my pacman? Since I installed ffrom source does it mean I can't update it automatically anymore?

Offline

#19 2021-01-03 22:47:31

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: Deleted /var/lib/pacman by accident

As you built pacman without passing any options to configure

$ ./configure

It will be installed under the prefix /usr/local while the pacman supplied by the pacman package is under the prefix /usr.
As the prefixes are different the installation does not conflict.  Which one you would be using depends on what is in $PATH and how it is ordered.

Offline

#20 2021-01-04 00:29:05

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

And how could I uinstall the one installed from source?

Offline

#21 2021-01-04 01:38:44

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: Deleted /var/lib/pacman by accident

See post #13

Offline

#22 2021-01-04 03:23:06

ericramirez
Member
Registered: 2015-09-29
Posts: 35

Re: Deleted /var/lib/pacman by accident

"make uninstall" didn't work

Offline

#23 2021-01-04 08:17:03

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Re: Deleted /var/lib/pacman by accident

"Didn't work" isn't an error message, https://bbs.archlinux.org/viewtopic.php?id=57855

Offline

#24 2022-07-26 11:10:47

puzzle
Member
Registered: 2019-03-09
Posts: 10

Re: Deleted /var/lib/pacman by accident

Oh, my God, I ignored this directory when backing up the system, so I'm also facing this problem now

Offline

#25 2022-07-26 11:55:48

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Deleted /var/lib/pacman by accident

puzzle, you have been asked not to bump old topics. Please stop. Consider this your final warning.

Closing.

Offline

Board footer

Powered by FluxBB