Adding repo for additional PHP versions - ERROR!

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Virtualmin version 7.20.2

Hi,
I am trying to add the repo for the additional PHP versions for Virtualmin on Ubuntu, but this is the error I got, when I’ve attempted to do it:

$ LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update
Error: must run as root

$ sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main'
Description:
Co-installable PHP versions: PHP 5.6, PHP 7.x, PHP 8.x and most requested extensions are included. Only Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided.

Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa

You can get more information about the packages at https://deb.sury.org

BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advised to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/

WARNING: add-apt-repository is broken with non-UTF-8 locales, see
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Adding repository.
Adding deb entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Adding key to /etc/apt/trusted.gpg.d/ondrej-ubuntu-php.gpg with fingerprint B8DC7E53946656EFBCE4C1DD71DAEAAB4AD4CAB6
Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]                    
Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]                       
Get:4 http://nova.clouds.archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]           
Get:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease [24.6 kB]
Get:6 http://nova.clouds.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2178 kB]
Get:7 http://nova.clouds.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1177 kB]        
Get:8 http://nova.clouds.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [28.9 kB]      
Get:9 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages [135 kB]               
Get:10 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main Translation-en [42.4 kB]             
Ign:11 https://software.virtualmin.com/vm/7/gpl/apt virtualmin InRelease                                  
Ign:11 https://software.virtualmin.com/vm/7/gpl/apt virtualmin InRelease
Ign:11 https://software.virtualmin.com/vm/7/gpl/apt virtualmin InRelease
Err:11 https://software.virtualmin.com/vm/7/gpl/apt virtualmin InRelease
  Could not connect to software.virtualmin.com:443 (2001:bc8:608:b01::1), connection timed out Could not connect to software.virtualmin.com:443 (51.158.66.131), connection timed out
Fetched 4241 kB in 38s (110 kB/s)
Reading package lists... Done
W: Failed to fetch https://software.virtualmin.com/vm/7/gpl/apt/dists/virtualmin/InRelease  Could not connect to software.virtualmin.com:443 (2001:bc8:608:b01::1), connection timed out Could not connect to software.virtualmin.com:443 (51.158.66.131), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

any ideas? Is your server online?

:neutral_face:

The interesting part is, that there is connection to this repo server

$ ping 51.158.66.131 -c 2
PING 51.158.66.131 (51.158.66.131) 56(84) bytes of data.
64 bytes from 51.158.66.131: icmp_seq=1 ttl=40 time=31.4 ms
64 bytes from 51.158.66.131: icmp_seq=2 ttl=40 time=31.2 ms

I even disabled the firewall for a while to see, if it’s not a problem on my end, but I get the same error

@ramones79,

Check out:

Have you read my posting in full?

I am exactly following the instructions, as on the page you refer me to.

@ramones79,

You need to run the command as “root” user or someone with “sudo” privileges.

software.virtualmin.com was down at the time. Have you tried again.

1 Like

@stefan1959,

software.virtualmin.com only updates Virtualmin software. If you read the first part of his error message, he wasn’t running the command as “root” user.

I did see a sudo there, seeing virtualmin was down I thought it may have interrupted things.

2 Likes

@stefan1959,

Good catch (again) :slight_smile:

Though adding a third party repo shouldn’t have an issue with existing repos. If running “apt update” it would cause an error, for which one could either ignore or simple disable the “broken” repo temporarily if desired.

Yes, it seems to be operational already and now it works.
Thanks!