Unable to install python2 - PGP keys aren't being trusted

Hello, I am trying to install Python 2.7 using makepkg. I keep getting the same PGP error. I have tried resetting all PGP keys, tried trusting the keys, rebooted, and nothing has worked to solve my issue.

 makepkg -i                        ✔ 
==> Making package: python2 2.7.18-11 (Sun 04 Aug 2024 10:38:30 PM CDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found Python-2.7.18.tar.xz
  -> Found Python-2.7.18.tar.xz.asc
  -> Found mtime-workaround.patch
  -> Found python-gentoo-patches-2.7.18_p16.tar.xz
==> Validating source files with sha512sums...
    Python-2.7.18.tar.xz ... Passed
    Python-2.7.18.tar.xz.asc ... Skipped
    mtime-workaround.patch ... Passed
    python-gentoo-patches-2.7.18_p16.tar.xz ... Passed
==> Verifying source file signatures with gpg...
    Python-2.7.18.tar.xz ... FAILED (the public key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF is not trusted)
==> ERROR: One or more PGP signatures could not be verified!
gpg --recv-key C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
gpg: key 04C367C218ADD4FF: "Benjamin Peterson <bp@benjamin.pe>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

:zap: [Need-To-Know] About Manjaro and AUR

Python 2 was sunsetting 2020-01-01.

Building 2.7 on a Manjaro system is likely going to create conflicts with the system pyhton - so don’t do that. Python 3.12 is the current version.

don’t mess with system python

Did you clone the current PKGBUILD ?

git clone https://aur.archlinux.org/python2
makepkg -scCr

If you need to use a python 2 script you could use 2to3-3.12 <scriptname.py> to upgrade the script to python 3.12 - even that is deprecated and not guaranteed to convert correct.

Just for the sake of verification

 $ git clone https://aur.archlinux.org/python2
Cloning into 'python2'...
[...]

 $ makepkg -scCr
[...]
==> Validating source files with sha512sums...
    Python-2.7.18.tar.xz ... Passed
    Python-2.7.18.tar.xz.asc ... Skipped
    mtime-workaround.patch ... Passed
    python-gentoo-patches-2.7.18_p16.tar.xz ... Passed
==> Verifying source file signatures with gpg...
    Python-2.7.18.tar.xz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting Python-2.7.18.tar.xz with bsdtar
==> Starting prepare()...
[...]

==> Creating package "python2"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: python2 2.7.18-11 (man 05 aug 2024 06:37:52 CEST)
==> Cleaning up...
==> Removing installed dependencies...

Custom packages are unsupported - I made the build available at https://manjaro.dk - the use of it is unsupported and at your own responsibility.

2 Likes

Python 2.7 should be installable as AUR package: AUR (en) - python2

I have it installed for years now on my Manjaro without any conflicts with other versions.

pyenv is another option for managing multiple versions of Python, and has the benefit of not touching system installs at all.

1 Like