I have a clean VPS, with Ubuntu 14.04 LTS x64. And Tried the following:
# Upgrade The Base Packages
apt-get update
apt-get upgrade -y
# Add A Few PPAs To Stay Current
apt-get install -y software-properties-common
apt-add-repository ppa:nginx/stable -y
apt-add-repository ppa:rwky/redis -y
apt-add-repository ppa:chris-lea/node.js -y
apt-add-repository ppa:ondrej/php5-5.6 -y
But then it fails at the last one:
root@xxx:~# apt-add-repository ppa:ondrej/php5-5.6 -y
gpg: keyring `/tmp/tmp9jdzm9kw/secring.gpg' created
gpg: keyring `/tmp/tmp9jdzm9kw/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp9jdzm9kw/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ond\xc5\x99ej Sur�" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 687, in addkey_func
func(**kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 370, in add_key
return apsk.add_ppa_signing_key()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 261, in add_ppa_signing_key
tmp_export_keyring, signing_key_fingerprint, tmp_keyring_dir):
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 210, in _verify_fingerprint
got_fingerprints = self._get_fingerprints(keyring, keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 202, in _get_fingerprints
output = subprocess.check_output(cmd, universal_newlines=True)
File "/usr/lib/python3.4/subprocess.py", line 605, in check_output
output, unused_err = process.communicate(inputdata, timeout=timeout)
File "/usr/lib/python3.4/subprocess.py", line 936, in communicate
stdout = _eintr_retry_call(self.stdout.read)
File "/usr/lib/python3.4/subprocess.py", line 487, in _eintr_retry_call
return func(*args)
File "/usr/lib/python3.4/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 92: ordinal not in range(128)
I couldn't figure out whats wrong. It's all pretty basic.
The proper way is to enable UTF-8 support in your terminal.
First check your locales:
locale -a
Then, install an UTF-8 locale, for en_US, the example as follows:
locale-gen en_US.UTF-8
Then you need to export it:
export LANG=en_US.UTF-8
Then the
add-apt-repository
command will work okay.If this still doesn't still work, try using this line:
LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php
I faced the same problem. I think the error comes because of the non western characters in the name (Ond\xc5\x99ej Sur�).
Make sure you removed php5.
You can add the repository manually:
Check with php -v whether you have 5.6 installed:
Try the following:
Please remove if you already installed php5.
Now try to a fresh installation.
Run
gedit /etc/apt/sources.list
to add following codes:Please careful to edit and add source code.
Save and update it. (1234)
Now try to install php5.
After installed you should get php5-5.6.
Try installing a language pack which may correct your issues with encoding, e.g.
This will provide English translation data updates for all supported packages (including Python).
See: UnicodeEncodeError: 'ascii' codec can't encode character.