You are not logged in.

#1 2018-01-31 01:14:05

dakota
Member
Registered: 2016-05-20
Posts: 415

[SOLVED] Pacman - Operations and Options

I've been reading the following pages:

Pacman
Pacman(8)
Pacman Tips and Tricks
Pacman - Rosetta

and I've looked in the following folders/files:

/var/cache/pacman/pkg/
/var/lib/pacman/sync/
/var/lib/pacman/local/

/var/log/pacman.log
/etc/pacman.conf
/etc/pacman.d/mirrorlist

... but I'm having difficulty with some of the concepts.

I know the following is very simplistic... but I am still at the simplistic stage -- trying to get a bird's eye view of what is going on.

Do I have the following correct?

1. 'Packages' are stored in repositories at archlinux.org and mirrored to many different sites to facilitate downloading.

2. A list of those sites is stored in /etc/pacman.d/mirrorlist (which I can edit and maintain).

3. During Arch installation, the pacstrap script creates the above directories and synchronizes /var/lib/pacman/sync with the first mirror in the mirrorlist.

4. This 'sync' database contains separate .db files for each repository that I have enabled. (On my system, I've got files for 'community', 'core', and 'extra'.) But these are not the packages. They are just the database. For simplicity, I'll call this the 'sync database'.

5. When I install packages, information from the sync database is copied into the 'local' database at /var/lib/pacman/local. But, again these are not packages, they are the database. For simplicity, I'll call this the 'local database'. [edit - nothing is copied from the sync database. This info comes from the packages themselves]

6. The actual package is downloaded from the mirror and placed in /var/cache/pacman/pkg/. This directory is never cleaned up automatically; this is something I need to do. For simplicity, I'll call this the 'cache'.

7. When I run pacamn, I specify the 'operation' with a capital letter (e.g., -D, -Q, -R, -S, -U, -F), followed by lower-case letters which define 'options' (and then followed by the 'target'). The operation letter defines the focus of the action (e.g., local database, sync database, files, cache).

Operation         Operates On
---------       ----------------
-D              local database (optionally, sync database)
-Q              local database (optionally, individual files)
-R              local database [edit - removed cache]
-S              sync database (but -- during upgrade and cleanup -- the cache and the local database, too)
-U              local database [edit - removed cache]
-F              sync database, files database ???

====================
QUESTION
Is the above essentially correct?

QUESTION
The documentation refers to the 'package database'. Is that what I'm calling the 'local database'? Or is it the 'sync database'? Or is it both?

The reason I'm asking is that one of the examples in man Pacman(8) is:

pacman -Ss ne.hack
    Search for regexp "ne.hack" in package database.

Shouldn't this say 'sync database' instead of 'package database'?

QUESTION
Where is the 'file database'? Is that installed on my machine? I would expect a query of the local database for all files owned by a given package (-Ql) to yield the same result as a query of the file database (-Fl). But it doesn't.

$ pacman -Ql bluefish
bluefish /usr/
bluefish /usr/bin/
... and many others
$ pacman -Fl bluefish
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist

A nudge in the right direction would be greatly appreciated.

Cheers,

Last edited by dakota (2021-11-13 03:30:38)


"Before Enlightenment chop wood, carry water. After Enlightenment chop wood, carry water." -- Zen proverb

Offline

#2 2018-01-31 03:04:13

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Pacman - Operations and Options

I think you are right on 1-7, but I am no expert.  As to your last question, -Ql will only list the files that are on your system.  So, when I don't have bluefish installed, I get

error: package 'bluefish' was not found

On the other hand, -Fs will search the database for each repo, so even though I don't have bluefish installed, it still lists all the files in the package.  For this to work, you need to periodically run

# pacman -Fy

to update the local database.

Last edited by circleface (2018-01-31 03:05:54)

Offline

#3 2018-01-31 03:04:40

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

Re: [SOLVED] Pacman - Operations and Options

I'd not be surprised if "package database" could be used ambiguously.  But I think it'd more often mean the sync database.

The "Files" databases are/will be right next to the sync databases as soon as you retrieve/update them with `-Fy`.


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

Offline

#4 2018-01-31 04:54:41

dakota
Member
Registered: 2016-05-20
Posts: 415

Re: [SOLVED] Pacman - Operations and Options

Thank you very much, circleface and Trilby!

Now that I know I'm on the right track, small ambiguities won't bother me so much. smile

Trilby wrote:

The "Files" databases are/will be right next to the sync databases as soon as you retrieve/update them with `-Fy`.

circleface wrote:

For this to work, you need to periodically run

# pacman -Fy

to update the local database.

Thanks to both of you! So, the 'files' database is not automatically created.

# pacman -Fy

creates it and must be used to refresh it. Now that I've created it, I see the 'files' database files listed along with the 'sync' database files at:

/var/lib/pacman/sync

Cheers,


"Before Enlightenment chop wood, carry water. After Enlightenment chop wood, carry water." -- Zen proverb

Offline

#5 2018-01-31 04:58:56

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: [SOLVED] Pacman - Operations and Options

As for your 1-7, #5 is the only one that I think you've got wrong. Nothing is copied from the sync databases to the local database, that all comes from the package.

-U and -R also have nothing to do with the cache.

Offline

#6 2018-01-31 07:58:34

dakota
Member
Registered: 2016-05-20
Posts: 415

Re: [SOLVED] Pacman - Operations and Options

Scimmia wrote:

As for your 1-7, #5 is the only one that I think you've got wrong. Nothing is copied from the sync databases to the local database, that all comes from the package.

Thank you!

Scimmia wrote:

-U and -R also have nothing to do with the cache.

Oops. You are so right! I was getting my directories mixed up. -U and -R affect the local database and leave the cache alone.

Cheers,


"Before Enlightenment chop wood, carry water. After Enlightenment chop wood, carry water." -- Zen proverb

Offline

Board footer

Powered by FluxBB