SnapOverflow

SnapOverflow Logo SnapOverflow Logo

SnapOverflow Navigation

  • Home
  • Server
  • Ubuntu

Mobile menu

Close
  • Home
  • System Administrators
    • Hot Questions
    • New Questions
    • Tags
  • Ubuntu
    • Hot Questions
    • New Questions
    • Tags
  • Help
Home / server / Questions / 666754
In Process
fiibaar
fiibaar
Asked: 2015-02-12 04:40:55 +0800 CST2015-02-12 04:40:55 +0800 CST 2015-02-12 04:40:55 +0800 CST

UnicodeDecodeError in Ubuntu while installing PHP5.6 from PPA

  • 772

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.

ubuntu-14.04
  • 4 4 Answers
  • 7854 Views

4 Answers

  • Voted
  1. Arda
    2015-10-10T13:44:14+08:002015-10-10T13:44:14+08:00

    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

    • 12
  2. Eric Delaet
    2015-02-28T08:19:45+08:002015-02-28T08:19:45+08:00

    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:

    # echo "deb http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu trusty main" > /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list
    
    # apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C
    
    # apt-get install php5
    

    Check with php -v whether you have 5.6 installed:

    # php -v
    PHP 5.6.6-1+deb.sury.org~trusty+1 (cli) (built: Feb 20 2015 11:22:10) 
    
    • 4
  3. shanmugam2138
    2015-02-12T04:54:27+08:002015-02-12T04:54:27+08:00

    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:

      deb http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu trusty main 
      deb-src http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu trusty main
      

      Please careful to edit and add source code.

    • Save and update it. (1234)

      sudo apt-get update  
      
    • Now try to install php5.

    After installed you should get php5-5.6.

    • 0
  4. kenorb
    2017-09-27T04:24:40+08:002017-09-27T04:24:40+08:00

    Try installing a language pack which may correct your issues with encoding, e.g.

    sudo apt-get install language-pack-en
    

    This will provide English translation data updates for all supported packages (including Python).

    See: UnicodeEncodeError: 'ascii' codec can't encode character.

    • 0

Sidebar

Stats

  • Questions 681965
  • Answers 980273
  • Best Answers 280204
  • Users 287326
  • Popular
  • Answers
  • Marko Smith

    Can you pass user/pass for HTTP Basic Authentication in URL parameters?

    • 5 Answers
  • Marko Smith

    Ping a Specific Port

    • 18 Answers
  • Marko Smith

    Check if port is open or closed on a Linux server?

    • 7 Answers
  • Marko Smith

    How to automate SSH login with password?

    • 10 Answers
  • Marko Smith

    How do I tell Git for Windows where to find my private RSA key?

    • 30 Answers
  • Marko Smith

    What's the default superuser username/password for postgres after a new install?

    • 5 Answers
  • Marko Smith

    What port does SFTP use?

    • 6 Answers
  • Marko Smith

    Command line to list users in a Windows Active Directory group?

    • 9 Answers
  • Marko Smith

    What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?

    • 3 Answers
  • Marko Smith

    How to determine if a bash variable is empty?

    • 15 Answers
  • Martin Hope
    Davie Ping a Specific Port 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    Smudge Our security auditor is an idiot. How do I give him the information he wants? 2011-07-23 14:44:34 +0800 CST
  • Martin Hope
    kernel Can scp copy directories recursively? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh returns "Bad owner or permissions on ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil How to automate SSH login with password? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin How do I deal with a compromised server? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner How can I sort du -h output by size 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent How to determine if a bash variable is empty? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus How do you find what process is holding a file open in Windows? 2009-05-01 16:47:16 +0800 CST

Related Questions

Trending Tags

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Home
  • Questions
    • Hot Questions
    • New Questions
  • Tags
  • Help

Footer

SnapOverflow

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Help

© 2022 SOF-TR. All Rights Reserve