You are not logged in.

#1 2019-11-29 09:53:46

wchouser3
Member
From: Indiana USA
Registered: 2013-08-13
Posts: 160
Website

[SOLVED] pacman-db-upgrade, and why

so normally when I do an upgrade, I use reflector to generate an optimized mirrorlist, then run :

sudo pacman -Syyu

how often should I run

sudo pacman-db-upgrade

and what does that command do that doesn't get done by the -Syyu command?

Last edited by wchouser3 (2019-12-04 19:00:14)


If you can't be helpful, don't say anything at all. Fair enough?

Offline

#2 2019-11-29 10:25:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,668

Re: [SOLVED] pacman-db-upgrade, and why

Looking at the script shows that it seems to be for updating the database format on pacman updates that introduce changes to how things are stored in the DB. It has no relation - and no relevance - to package updates you are doing  with -Syy and you'd never have to explicitly run it manually (it would mostly be relevant on pacman updates introducing things here, in which case they are likely to be handled by install scripts or alpm hooks).

FWIW since mirrors aren't changing "that" frequently, it'd probably be better if you didn't compulsively regenerate the mirrorlist on every update and run complete DB refreshes with -yy, should the databases for a given repo already be up to date then there's no need to redownload the database update, which might save a bit of bandwidth and load.

Offline

#3 2019-11-29 11:34:45

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,385
Website

Re: [SOLVED] pacman-db-upgrade, and why

pacman will tell you if you need to run pacman-db-upgrade.  This was needed twice in the history of the project.

Offline

#4 2019-12-04 18:53:30

wchouser3
Member
From: Indiana USA
Registered: 2013-08-13
Posts: 160
Website

Re: [SOLVED] pacman-db-upgrade, and why

V1del wrote:

Looking at the script shows that it seems to be for updating the database format

yes, I get it now. it makes sense that the information is a bit vague for the average "end user." It's not meant to be used except for a couple of extremely rare cases.


If you can't be helpful, don't say anything at all. Fair enough?

Offline

#5 2019-12-04 18:58:35

wchouser3
Member
From: Indiana USA
Registered: 2013-08-13
Posts: 160
Website

Re: [SOLVED] pacman-db-upgrade, and why

V1del wrote:

FWIW since mirrors aren't changing "that" frequently, it'd probably be better if you didn't compulsively regenerate the mirrorlist on every update and run complete DB refreshes with -yy, should the databases for a given repo already be up to date then there's no need to redownload the database update, which might save a bit of bandwidth and load.

Bandwidth isn't a big issue, it's just that I'm never sure without looking carefully at the list of downloads whether there is a mirrorlist update. I have a simple little script that updates the mirrorlist, refreshes the repos, does the updates then clears the cache of all but the latest three of each package. I suppose I could figure out how to make a script to check whether the mirrorlist is updated and only execute reflector if such update exists. It would take a bit of research on my part.


If you can't be helpful, don't say anything at all. Fair enough?

Offline

#6 2019-12-04 18:59:19

wchouser3
Member
From: Indiana USA
Registered: 2013-08-13
Posts: 160
Website

Re: [SOLVED] pacman-db-upgrade, and why

Allan wrote:

pacman will tell you if you need to run pacman-db-upgrade.  This was needed twice in the history of the project.

that's interesting. thanks for your reply.


If you can't be helpful, don't say anything at all. Fair enough?

Offline

#7 2019-12-18 17:46:27

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] pacman-db-upgrade, and why

wchouser3 wrote:

Bandwidth isn't a big issue, it's just that I'm never sure without looking carefully at the list of downloads whether there is a mirrorlist update.

These are two different issues. Regardless of your mirrorlist workflow, DO NOT use pacman -Syyu. The duplicated -y does not do what you think it does.

What it does, is when pacman sees there are no updates, -yy says "I don't care, I believe the website is lying to me. Update anyway." This can be useful in the event that you genuinely believe the mirror is horrifically broken. It can also be useful if you accidentally broke your databases by downloading html files from a captive portal. Unless you already know that you need this, you do not need this.

In most cases, it is completely useless, serving only to waste bandwidth (both yours and the server's).

In some cases, e.g. if a mirror temporarily 404'ed and you used a second mirror that was running faster, then you'll actually downgrade your repos, and open yourself up to partial updates, which means you lose your warranty. wink

To be clear: there is NEVER a valid reason to use -yy as the default option, and it is ONLY to be used in special circumstances, when you know you need it to fix database corruption. Using it when there is no database corruption, will instead cause new database corruption.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2019-12-23 21:16:13

wchouser3
Member
From: Indiana USA
Registered: 2013-08-13
Posts: 160
Website

Re: [SOLVED] pacman-db-upgrade, and why

eschwartz wrote:

To be clear: there is NEVER a valid reason to use -yy as the default option, and it is ONLY to be used in special circumstances, when you know you need it to fix database corruption. Using it when there is no database corruption, will instead cause new database corruption.

That's interesting. I hadn't thought of it that way. Thank you


If you can't be helpful, don't say anything at all. Fair enough?

Offline

Board footer

Powered by FluxBB