Unable to add ondrej repository apt in Ubuntu 20.04
I am unable to add ondrej to my Ubuntu 20.04 installation.
sudo add-apt-repository ppa:ondrej/php
The above command returns the following error
Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 363, in <module> addaptrepo = AddAptRepository() File "/usr/bin/add-apt-repository", line 41, in __init__ self.distro.get_sources(self.sourceslist) File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 91, in get_sources raise NoDistroTemplateException(
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Ubuntu/focalFollowing is the LSB release information.
Distributor ID: Ubuntu
Description:Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focalAm I doing anything wrong?
End goal: I want to be able to install PHP 8.1 extensions from apt
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"apt-cache policy ->
aptitude search ~o ->
namei /etc/os-release ->
cat /etc/os-release -> 14 1 Answer
I could not get the add-apt-repository command to work so I added the repository and the signing key manually using the following commands:
Open the
sources.listfile with a text editor (for examplenano):sudo nano /etc/apt/sources.listAdd the following lines to the file:
deb focal main #deb-src focal mainAdd the repository signing key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4f4ea0aae5267a6c