2

I am attempting to install php7.4 after officially upgrading from 20.04 to 22.04

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"

Running add-apt-repository ppa:ondrej/php results in the following error:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 364, in <module>
    sys.exit(0 if addaptrepo.main() else 1)
  File "/usr/bin/add-apt-repository", line 347, in main
    shortcut = handler(source, **shortcut_params)
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuts.py", line 40, in shortcut_handler
    return handler(shortcut, **kwargs)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 82, in __init__
    if self.lpppa.publish_debug_symbols:
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 120, in lpppa
    self._lpppa = self.lpteam.getPPAByName(name=self.ppaname)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 107, in lpteam
    self._lpteam = self.lp.people(self.teamname)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 98, in lp
    self._lp = login_func("%s.%s" % (self.__module__, self.__class__.__name__),
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 494, in login_anonymously
    return cls(
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 230, in __init__
    super(Launchpad, self).__init__(
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 472, in __init__
    self._wadl = self._browser.get_wadl_application(self._root_uri)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 451, in get_wadl_application
    return Application(url, content)
  File "/usr/lib/python3/dist-packages/wadllib/application.py", line 1139, in __init__
    self.doc = self._from_string(markup)
  File "/usr/lib/python3/dist-packages/wadllib/application.py", line 1178, in _from_string
    return self._from_stream(io.BytesIO(markup))
  File "/usr/lib/python3/dist-packages/wadllib/application.py", line 1163, in _from_stream
    for event, elem in ET.iterparse(stream, events):
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1260, in iterator
    yield from pullparser.read_events()
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1331, in read_events
    raise event
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1303, in feed
    self._parser.feed(data)
xml.etree.ElementTree.ParseError: mismatched tag: line 16, column 14
python -V
Python 3.10.4

I have seen several other posts talking about possible solutions. I have added language packs, and trying to manually add the repository and import the public key doesnt work.

The manual method I tried just didn't work. Output:

gpg --keyserver keyserver.ubuntu.com --recv 4F4EA0AAE5267A6C
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 4F4EA0AAE5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1

apt update Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease Get:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Hit:5 http://nginx.org/packages/mainline/ubuntu focal InRelease
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease [23.9 kB] Err:6 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C Reading package lists... Done W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C E: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

Checking the keys after adding shows the ppa repo key is PRESENT

apt-key list
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
/etc/apt/trusted.gpg
--------------------
pub   rsa1024 2009-01-26 [SC]
      14AA 40EC 0831 7567 56D7  F66C 4F4E A0AA E526 7A6C
uid           [ unknown] Launchpad PPA for Ondřej Surý

pub rsa4096 2012-05-11 [SC] 790B C727 7767 219C 42C8 6F93 3B4F E6AC C0B2 1F32 uid [ unknown] Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg

pub rsa4096 2018-09-17 [SC] F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C uid [ unknown] Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>

But apt update still results in it saying it doesn't have the public key??

pt update
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [109 kB]
Hit:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease            
Get:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease [23.9 kB]   
Hit:6 http://nginx.org/packages/mainline/ubuntu focal InRelease
Err:5 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
E: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

What am I missing here? The key is present, why is apt acting like it isnt?

EDIT: As I have mentioned above, adding the key with either apt-key or gpg does not work.

0 Answers0