我正在尝试在 mediawiki 映像上安装 php-ldap,该映像使用 php:7.2-apache 进行 Kubernetes 部署。我已经运行了 apt-get update 并尝试添加 ppa。
apt-get install php-ldap
php7.3-ldap 7.3.4-1+0~20190412071350.37+stretch~1.gbpabc171 [Not candidate version]
php7.2-ldap 7.2.17-1+0~20190412071344.20+stretch~1.gbp23a36d [Not candidate version]
php7.1-ldap 7.1.28-1+0~20190412071216.17+stretch~1.gbpbe9b36 [Not candidate version]
php7.0-ldap 7.0.33-6+0~20190412071436.12+stretch~1.gbp26747c [Not candidate version]
php5.6-ldap 5.6.40-6+0~20190412071127.13+stretch~1.gbp7ce36b [Not candidate version]
php7.3-ldap 7.3.4-2 [Not candidate version]
php7.0-ldap 7.0.33-0+deb9u3 [Not candidate version]
php7.0-ldap 7.0.33-0+deb9u1 [Not candidate version]
E: Package 'php-ldap' has no installation candidate
> add-apt-repository ppa:ondrej/php Co-installable PHP versions: PHP
> 5.6, PHP 7.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php) for
> Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are
> provided. Don't ask for end-of-life PHP versions or Ubuntu release,
> they won't be 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 advise 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 Press [ENTER] to
> continue or ctrl-c to cancel adding it
>
> gpg: keybox '/tmp/tmpnxnei5m6/pubring.gpg' created gpg:
> /tmp/tmpnxnei5m6/trustdb.gpg: trustdb created gpg: key
> 4F4EA0AAE5267A6C: public key "Launchpad PPA for Ond\xc5\x99ej Sur�"
> imported gpg: Total number processed: 1 gpg: imported: 1
> Exception in thread Thread-1: Traceback (most recent call last):
> File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
> self.run() File "/usr/lib/python3.5/threading.py", line 862, in run
> self._target(*self._args, **self._kwargs) File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py",
> line 688, in addkey_func
> func(**kwargs) File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 386,
> in add_key
> return apsk.add_ppa_signing_key() File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 263,
> in add_ppa_signing_key
> tmp_export_keyring, signing_key_fingerprint, tmp_keyring_dir): File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line
> 212, in _verify_fingerprint
> got_fingerprints = self._get_fingerprints(keyring, keyring_dir) File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line
> 204, in _get_fingerprints
> output = subprocess.check_output(cmd, universal_newlines=True) File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
> **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 385, in run
> stdout, stderr = process.communicate(input, timeout=timeout) File "/usr/lib/python3.5/subprocess.py", line 788, in communicate
> stdout = self.stdout.read() File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
> return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
> 223: ordinal not in range(128)
答案1
请注意,您的屏幕上出现了以下警告:
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 Press [ENTER] to
continue or ctrl-c to cancel adding it
由于您没有按照指定的格式重新运行命令,因此出现错误。
要解决该问题,请按照消息中要求的操作进行操作:
# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php