You are not logged in.
I want to see what the default config is for the config file /etc/inputrc
$ pkgfile /etc/inputrc
core/readline
$ mkdir pkg
$ sudo pacman -Syw --cachedir pkg readline
:: Synchronizing package databases...
core is up to date
extra is up to date
multilib is up to date
resolving dependencies...
Packages (1) readline-8.3.003-1
Total Download Size: 0,40 MiB
:: Proceed with download? [Y/n] y
:: Retrieving packages...
error: could not open file /home/bedna/pkg/download-RSdhpC/readline-8.3.003-1-x86_64.pkg.tar.zst.part: Permission denied
error: failed to setup a download payload for readline-8.3.003-1-x86_64.pkg.tar.zst
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.
$ mkdir db
$ sudo pacman -Syw --cachedir pkg --dbpath db --needed --noconfirm readline
:: Synchronizing package databases...
error: could not open file /home/bedna/db/sync/download-JKLTnd/core.db.part: Permission denied
error: failed to setup a download payload for core.db
error: failed to synchronize all databases (failed to retrieve some files)What am I doing wrong here?
Is there an easier way to just cat the file /etc/inputrc directly via pacman, maybe using pacman -F somehow?
Thank you in advance.
Last edited by Bedna (2026-07-21 15:29:34)
Offline
Online
Not directly via pacman, but I wrote a short script for this same purpose some time ago:
#!/bin/sh
[ $# -lt 2 ] && exit 1
uri=$(pacman -Sp $1)
path=$(pacman -Flq $1 | grep -m 1 /$2$)
[ -z "$uri" ] && exit 1
[ -z "$path" ] && exit 2
curl -sL $uri | bsdtar xOf - $pathI call this pacdefault, and it is used as `pacdefault PKGNAME FILENAME`
This uses the local package cache if the package is currently installed (or otherwise still available in the cache) or gets it from a mirror if needed, but nothing is saved as it is curled right to bsdtar and only the requested file's contents is sent to stdout (everything else ignored / discarded).
Last edited by Trilby (2026-07-21 11:27:17)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Not directly via pacman, but I wrote a short script for this same purpose some time ago:
#!/bin/sh [ $# -lt 2 ] && exit 1 uri=$(pacman -Sp $1) path=$(pacman -Flq $1 | grep -m 1 /$2$) [ -z "$uri" ] && exit 1 [ -z "$path" ] && exit 2 curl -sL $uri | bsdtar xOf - $pathI call this pacdefault, and it is used as `pacdefault PKGNAME FILENAME`
This uses the local package cache if the package is currently installed (or otherwise still available in the cache) or gets it from a mirror if needed, but nothing is saved as it is curled right to bsdtar and only the requested file's contents is sent to stdout (everything else ignored / discarded).
The grep won't work, pacman -Flq returns paths without leading /, but with a little modification it's a very clever way of doing it:
#!/bin/sh
[ $# -lt 2 ] && exit 1
uri=$(pacman -Sp $1)
path="${2#/}"
path=$(pacman -Flq $1 | grep ^"$path"$)
[ -z "$uri" ] && echo "$1 does not exist" && exit 2
[ -z "$path" ] && echo "$2 does not exist in $1" && exit 3
curl -sL "$uri" | bsdtar xOf - "$path"
exit 0Or simplified by only providing the path to the file (if only one package provides the file), eg: `./pacdefault FILENAME`:
#!/usr/bin/env bash
[ $# -lt 1 ] && echo 'no path provided' && exit 1
pkg=$(pkgfile "$1")
[ -z "$pkg" ] && echo "no package found for $1" && exit 2
uri=$(pacman -Sp "$pkg")
path=${1#/}
curl -sL "$uri" | bsdtar xOf - "$path"
exit 0Thank you both!
Last edited by Bedna (2026-07-21 16:04:06)
Offline
I suspect Trilby calls "pacdefault readline inputrc" and you called "pacdefault readline /etc/inputrc"
The former works (most of the time, unless the file resides in /) but is inherently ambiguous (try that w/ some "settings.ini"
)
Online
It would work fine with a settings.ini and is not really that ambiguous. Very few packages contain a two files with the same name - and if they did, you'd probably want to see both of them.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
settings.ini was just the most generic bland filename I came up with and I assume if this was a frequent problem you'd have changed the script, but
path=$(pacman -Flq $1 | grep -m 1 /$2$)
will not show both files.
Anyway, I mostly wanted to point out why you disagreed on "does this works the way it's is?"
Online
Oops, okay, it will not find both files in a given package. But I read your critique as the script having ambiguity among all the possible settings.ini in any package in the repo (which could happen with `pacman -F settings.ini`) but that hurdle isn't applicable here.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline