You are not logged in.

#1 2020-01-20 18:11:12

hmogni
Member
From: .ma
Registered: 2019-08-28
Posts: 15

[SOLVED] Errors installing pacman from source files

I did compile pacman from source files (autoconf, ./configure, make, sudo make install). first when I tried to install a given package I got 

error: failed to commit transaction (invalid or corrupted package (PGP signature).

. when I run pacman-key --populate archlinux I get this error

error: The keyring file /usr/local/share/pacman/keyrings/archlinux.gpg does not exist

after some research I found in another thread that I needed the archlinux-keyring package (after setting SigLevel = Never in pacman.conf)

here is what I get

sudo pacman -S archlinux-keyring 
[sudo] password for hmogni: 
resolving dependencies...
looking for conflicting packages...

Packages (1) archlinux-keyring-20200108-1

Total Installed Size:  1.19 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                         [############################################################] 100%
(1/1) checking package integrity                                                                       [############################################################] 100%
(1/1) loading package files                                                                            [############################################################] 100%
(1/1) checking for file conflicts                                                                      [############################################################] 100%
error: failed to commit transaction (conflicting files)
archlinux-keyring: /usr/share/pacman/keyrings/archlinux-revoked exists in filesystem
archlinux-keyring: /usr/share/pacman/keyrings/archlinux-trusted exists in filesystem
archlinux-keyring: /usr/share/pacman/keyrings/archlinux.gpg exists in filesystem
Errors occurred, no packages were upgraded.

output of pacman -v

$ pacman -v
Root      : /
Conf File : /usr/local/etc/pacman.conf
DB Path   : /usr/local/var/lib/pacman/
Cache Dirs: /usr/local/var/cache/pacman/pkg/  
Hook Dirs : /usr/local/share/libalpm/hooks/  /usr/local/etc/pacman.d/hooks/  
Lock File : /usr/local/var/lib/pacman/db.lck
Log File  : /usr/local/var/log/pacman.log
GPG Dir   : /usr/local/etc/pacman.d/gnupg/
Targets   : None
error: no operation specified (use -h for help)

content of /usr/local/var/lib/pacman

#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
#HookDir     = /etc/pacman.d/hooks/
HoldPkg     = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
#Color
#TotalDownload
CheckSpace
#VerbosePkgLists

# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel    = Never 
#Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.

#
# 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.
#

# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

[testing]
Include = /etc/pacman.d/mirrorlist

[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

#[community-testing]
#Include = /etc/pacman.d/mirrorlist

[community]
Include = /etc/pacman.d/mirrorlist

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.

#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist

#[multilib]
#Include = /etc/pacman.d/mirrorlist

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

Last edited by hmogni (2020-01-20 23:35:02)

Offline

#2 2020-01-20 18:32:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,399

Re: [SOLVED] Errors installing pacman from source files

Yes you have a distinct pacman database trying to overwrite existing files (from another database). What exactly is the point of this exercise?

Offline

#3 2020-01-20 18:36:08

hmogni
Member
From: .ma
Registered: 2019-08-28
Posts: 15

Re: [SOLVED] Errors installing pacman from source files

I'm intending to learn about pacman's source code; editing, compiling, running...etc.

Offline

#4 2020-01-20 18:40:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,399

Re: [SOLVED] Errors installing pacman from source files

Install and set up in a chroot then, right now you have conflicts with your self compiled database and it wanting to install "new files" that are already part of your normal system: https://wiki.archlinux.org/index.php/De … ean_chroot

or of course reconfigure it to use the system's database, but depending on what you want to "experiment" with, it's likely safer to do so in an isolated system.

Last edited by V1del (2020-01-20 18:41:46)

Offline

#5 2020-01-20 20:16:07

hmogni
Member
From: .ma
Registered: 2019-08-28
Posts: 15

Re: [SOLVED] Errors installing pacman from source files

ok thank you for your answers. I uninstalled my compiled version of pacman and will be *experimenting* in a chroot environment from now on.

Offline

#6 2020-01-20 21:30:20

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

Re: [SOLVED] Errors installing pacman from source files

Conf File : /usr/local/etc/pacman.conf
DB Path   : /usr/local/var/lib/pacman/
Cache Dirs: /usr/local/var/cache/pacman/pkg/ 
Hook Dirs : /usr/local/share/libalpm/hooks/  /usr/local/etc/pacman.d/hooks/ 
Lock File : /usr/local/var/lib/pacman/db.lck
Log File  : /usr/local/var/log/pacman.log
GPG Dir   : /usr/local/etc/pacman.d/gnupg/

All your configs are pointing to ./configure --prefix=/usr/local and corresponding annoying defaults for e.g. sysconfdir/localstatedir. You'd ideally want to use the same pacman database as your real pacman version, but merely swap out your pacman binary.

e.g. your GPG Dir was empty, while the one installed with arch linux itself has the keys.

The official packages use:  --prefix=/usr --sysconfdir=/etc --localstatedir=/var, which you'll probably also want to do. You can modify the PKGBUILD in core, or use pacman-git in the AUR, in order to build a package that uses your own modified pacman sources.

Another option for local development is to configure using --prefix=/usr --sysconfdir=/etc --localstatedir=/var, but instead of using make install, run pacman directly from the build tree via ./src/pacman/pacman

Last edited by eschwartz (2020-01-20 23:36:06)


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

Offline

#7 2020-01-20 23:34:13

hmogni
Member
From: .ma
Registered: 2019-08-28
Posts: 15

Re: [SOLVED] Errors installing pacman from source files

thank you eschwartz for your thorough explanation. That helped clearing up how things works!

Offline

Board footer

Powered by FluxBB