You are not logged in.

#1 2019-11-27 12:26:05

b1inki
Member
Registered: 2018-12-03
Posts: 14

[SOLVED] Question about pacman, partial upgrades, sync db's...

First of all, I know that similar stuff have been discussed at length already - I read the tech wiki about
partial upgrades and the old forum threads about the readline breaking a lot of systems 10 years ago:
https://bbs.archlinux.org/viewtopic.php?id=241092

Thinking about these stuff I keep wondering - why does pacman even store a sync db on the machine,
if, for a rolling release (Arch), you need to always do full system updates (which implies always
checking/fetching a new db) ?
Or maybe pacman stores a local db, with the idea that you only fetch a new db if it was updated
(so use -Syu instead of -Syyu) as if you always fetch the db you will needlessly put more traffic on the
db servers ?
Or maybe storing the db locally would also allow pacman to be used for point release distros -
the db will then be updated rarely and there would be no need to constantly fetch it from the servers?

The reason I'm asking is that recently broke my system (unrelated to the topic)
and while fixing, I figured I might get a better understanding of how pacman works.

Last edited by b1inki (2019-11-27 14:39:29)

Offline

#2 2019-11-27 13:34:46

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

Re: [SOLVED] Question about pacman, partial upgrades, sync db's...

Firstly, pacman is not only used in rolling release distros.

Also, I quite often "pacman -Syu" and a few days later want to install software.  Usually, "pacman -S foo" works fine, assuming I updated recently.   If it does not, then I need a "pacman -Syu foo". 

Or if I am bold, a partial update...  I helps I know what I am doing, and can judge breakage risk.

Offline

#3 2019-11-27 13:36:18

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

Re: [SOLVED] Question about pacman, partial upgrades, sync db's...

b1inki wrote:

Thinking about these stuff I keep wondering - why does pacman even store a sync db on the machine,
if, for a rolling release (Arch), you need to always do full system updates (which implies always
checking/fetching a new db) ?

You don't always need to.  As long as you have updated relatively recently, you can install new packages with `pacman -S $pkgname`.  This is never harmful.  It may, on occasion, fail if you have not updated recently and the version listed in your local sync db is no longer available on the mirrors - but that would be a harmless failure: you'd just have to then update.

You can also query the local sync database without needing network access, e.g., to get information about packages you don't have installed: `pacman -Si $pkgname`.  There are several other similar operations which can use the local sync db.

b1inki wrote:

Or maybe pacman stores a local db, with the idea that you only fetch a new db if it was updated
(so use -Syu instead of -Syyu) as if you always fetch the db you will needlessly put more traffic on the
db servers ?

Correct.  This is why `pacman -Syyu` is discouraged.  It is harmless for the system it is run on, but it wastes bandwidth and mirror server resources.  When you run `pacman -Syu` you may sometimes see messages that repos are up to date, so the repo dbs are not downloaded again.

b1inki wrote:

Or maybe storing the db locally would also allow pacman to be used for point release distros -
the db will then be updated rarely and there would be no need to constantly fetch it from the servers?

I'm not sure about point release distros, but this basically goes back to my first point: the local sync db can (and is) used for installing new packages (like in a point release system) or getting package info.

EDIT: I suppose on a point release distro, devs are essentially committing to keeping a set version of packages on the mirrors until the next point release.  So one would never need to -Syu again, but continue adding packages as desired with -S - the original local sync db would continue to be sufficient.  But the only difference in arch and point-release distros on this point is the time scale.  On point release distros, you know your local sync db will be good until he version you use passes it's supported period.  On arch, the local sync db will be good until .... well, until it isn't.

Last edited by Trilby (2019-11-27 13:40:33)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2019-11-27 13:55:04

b1inki
Member
Registered: 2018-12-03
Posts: 14

Re: [SOLVED] Question about pacman, partial upgrades, sync db's...

Thank you for the replies, gents.

For some reason this one never crossed my mind:

You can also query the local sync database without needing network access

And it makes a lot of sense doing fast queries on your local copy.

I consider my questions answered.

Offline

#5 2019-11-27 14:02:51

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

Re: [SOLVED] Question about pacman, partial upgrades, sync db's...

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

Board footer

Powered by FluxBB