You are not logged in.
Hi,
I would like to download a copy of the pacman sync database files from a remote Archlinux server, and store them into a specified location.
After that the stored copy of database will be queried using package-query to check what version of specified package is available.
Can I do this from pacman, a pacman related utility, or any other program?
Thanks in advance.
Last edited by aaditya (2014-09-28 17:21:10)
Offline
Have a look at the pacman man page, in particular the -b/--dbpath and -r/--root options.
Last edited by tomk (2014-09-28 15:58:57)
Offline
Have a look at the pacman man page, in particular the -b/--dbpath and -r/--root options.
Thanks, that answers half of my question.
Now I can download the pacman database to the current directory using
sudo pacman -b . -SyIs there any way I can specify the mirror for pacman to download the sync database files from?
Last edited by aaditya (2014-09-28 17:26:15)
Offline
/etc/pacman.conf or /etc/pacman.d/mirrorlist .
Offline
/etc/pacman.conf or /etc/pacman.d/mirrorlist .
Thanks, I guess that answers the second part as well.
Now I am using the command
sudo pacman --config ./pacman-i686.conf -b . -Syand the contents of pacman-i686.conf is
#
# pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives#
# GENERAL OPTIONS
#
[options]
Architecture = auto
DBPath = .#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#[core]
SigLevel = PackageRequired
Server = ftp://ftp.archlinux.org/$repo/os/$arch[extra]
SigLevel = PackageRequired
Server = ftp://ftp.archlinux.org/$repo/os/$arch[community]
SigLevel = PackageRequired
Server = ftp://ftp.archlinux.org/$repo/os/$arch
and for querying I can use
pacman --config ./pacman-i686.conf -Ss mousepadMarking as solved.
Offline
Why don't you make functions in you shell's rc so you need not type such long commands.
Offline
Slightly related:
If I am downloading the database files to my current folder (owned by my user), can I run pacman as non-root?
At present I have to use sudo pacman --config ./pacman-i686.conf -b . -Sy
Offline
Slightly related:
If I am downloading the database files to my current folder (owned by my user), can I run pacman as non-root?
At present I have to use sudo pacman --config ./pacman-i686.conf -b . -Sy
I'd suggest you convert the download logic into a script without pacman. You need a mirror, the path to the database file, and curl. For querying I'd think about using expac and patching it to accept a different configuration file.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
aaditya wrote:Slightly related:
If I am downloading the database files to my current folder (owned by my user), can I run pacman as non-root?
At present I have to use sudo pacman --config ./pacman-i686.conf -b . -SyI'd suggest you convert the download logic into a script without pacman. You need a mirror, the path to the database file, and curl. For querying I'd think about using expac and patching it to accept a different configuration file.
Maybe some other time..
At the moment just looking for something to get the job done.
Offline
The example implementation pycman from pyalpm works without root if the database is writable:
pycman-sync -yb /tmp/testdb
pycman-sync -sb /tmp/testdb package_nameLast edited by progandy (2014-09-28 19:36:04)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
The example implementation pycman from pyalpm works without root if the database is writable:
pycman-sync -yb /tmp/testdb pycman-sync -sb /tmp/testdb package_name
Thanks, will give it a go tomorrow.
Offline