我正在尝试将 repo 添加到 apt-get 中,但由于 ELF 标头问题,它失败了
sudo add-apt-repository -y ppa:chris-lea/node.js
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 44, in <module>
from xml.sax.saxutils import escape
File "/usr/lib/python3.4/xml/sax/saxutils.py", line 6, in <module>
import os, urllib.parse, urllib.request
File "/usr/lib/python3.4/urllib/request.py", line 88, in <module>
import http.client
File "/usr/lib/python3.4/http/client.py", line 69, in <module>
import email.parser
File "/usr/lib/python3.4/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.4/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib/python3.4/email/message.py", line 15, in <module>
from email import utils
File "/usr/lib/python3.4/email/utils.py", line 30, in <module>
import datetime
ImportError: /usr/bin/datetime.so: wrong ELF class: ELFCLASS32
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in <module>
from urllib.request import urlopen
File "/usr/lib/python3.4/urllib/request.py", line 88, in <module>
import http.client
File "/usr/lib/python3.4/http/client.py", line 69, in <module>
import email.parser
File "/usr/lib/python3.4/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.4/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib/python3.4/email/message.py", line 15, in <module>
from email import utils
File "/usr/lib/python3.4/email/utils.py", line 30, in <module>
import datetime
ImportError: /usr/bin/datetime.so: wrong ELF class: ELFCLASS32
我已经尝试使用重新安装日期时间库sudo apt-get install --reinstall --purge libpython3.4-stdlib libpython2.7-stdlib
有办法修复此问题吗?我正在运行:3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
答案1
因为这apt-file search /usr/bin/datetime.so
不返回任何输出:
/usr/bin/datetime.so
通过备份删除文件:
sudo mv /usr/bin/datetime.so /usr/bin/datetime.so.bak
然后再次运行:
sudo add-apt-repository -y ppa:chris-lea/node.js