You are not logged in.

#1 2019-06-27 04:45:08

Starclimber
Member
From: Mars
Registered: 2018-12-23
Posts: 13

[SOLVED] Pacman backup local database with hook

At what stage is /var/lib/pacman/local updated when you install or remove a package using pacman?

Is it possible to, say, rsync or tar pacman's local database before installation/removal using

When = PreTransaction

in a pacman hook?

Last edited by Starclimber (2019-06-27 20:02:50)

Offline

#2 2019-06-27 11:41:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,578
Website

Re: [SOLVED] Pacman backup local database with hook

Why would you want to back up the local database?  There's nothing there that's not trivial to recover from your package cache or just a simple pacman command.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2019-06-27 17:00:07

Starclimber
Member
From: Mars
Registered: 2018-12-23
Posts: 13

Re: [SOLVED] Pacman backup local database with hook

Trilby wrote:

Why would you want to back up the local database?

Honestly I don't know about pacman extensively, I was reading through the Arch wiki (1) (2) and thought it wouldn't be much effort to set up just in case.

Trilby wrote:

There's nothing there that's not trivial to recover from your package cache or just a simple pacman command.

I don't remove recent versions of package caches so I guess I don't need this. By simple pacman command are you referring to "pacman -Dk" or "pacman -Dkk"?

Offline

#4 2019-06-27 17:32:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,578
Website

Re: [SOLVED] Pacman backup local database with hook

Ah, I suppose the installation reason can't be (trivially) recovered.  I suppose there are use-cases for having a backup of the local database, but frankly they're far far more rare than might be inferred from reading those wiki pages.

I've been using arch linux for about a decade on several machines and I do all sorts of whacky experimenting and I've never had any reason to even consider backing up the local database.  Perhaps that's just me though.

In any case, if you do want to do it as a pacman hook, you'd probably want it as a *post* transaction hook.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2019-06-27 20:02:35

Starclimber
Member
From: Mars
Registered: 2018-12-23
Posts: 13

Re: [SOLVED] Pacman backup local database with hook

Thanks for the input, a post transaction hook works too. Marked as solved. :-)

Offline

Board footer

Powered by FluxBB