简体   繁体   English

在 Pop._OS 22.04 上运行 apt-get 命令时出现 httplib2 错误

[英]Getting httplib2 error when running apt-get commands on Pop!_OS 22.04

I just updated to pop os 22.04 lts and now not only it can't detect any output and input devices on my computer but I also can't run any apt-get commands, whenever I try to run it I receive the error:我刚刚更新到 pop os 22.04 lts,现在它不仅无法检测到我计算机上的任何 output 和输入设备,而且我也无法运行任何 apt-get 命令,每当我尝试运行它时,我都会收到错误消息:

from httplib2.error import ServerNotFoundError
ModuleNotFoundError: No module named 'httplib2.error'
dpkg: error processing package pop-default-settings (--configure):
 installed pop-default-settings package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 pop-default-settings
E: Sub-process /usr/bin/dpkg returned an error code (1)
/etc/apt/sources.list.d/pop-os-apps.sources:URIs: http://apt.pop-os.org/proprietary
Traceback (most recent call last):
  File "/usr/bin/apt-manage", line 32, in <module>
    from repolib import command
  File "/usr/lib/python3/dist-packages/repolib/command/__init__.py", line 24, in <module>
    from .add import Add
  File "/usr/lib/python3/dist-packages/repolib/command/add.py", line 23, in <module>
    from httplib2.error import ServerNotFoundError

I tried running pip install httplib2 but then I get我尝试运行pip install httplib2但后来我得到了

Command 'pip' not found, but can be installed with: sudo apt install python3-pip

If I try to run sudo apt install python3-pip I get the httplib2 error.如果我尝试运行 sudo apt install python3-pip 我会收到 httplib2 错误。

python3 --version returns Python 3.10.6 python3 --version 返回 Python 3.10.6

Happened to me too.我也发生过。 It seemed to be happening because /usr/lib/python3/dist-packages/ had httplib2 version 0.18 when a newer version was expected.它似乎正在发生,因为/usr/lib/python3/dist-packages/有 httplib2 版本 0.18,而预期有更新的版本。 Normally, doing sudo apt install python3-httplib2 would be the way to update this packge.通常,执行sudo apt install python3-httplib2将是更新此包的方法。 Since that was currently impossible, I manually overwrote the package with a newer version.由于目前这是不可能的,所以我用更新的版本手动覆盖了 package。

python3 -m pip install --upgrade httplib2
python3 -m pip show httplib2

This should install an up-to-date version (at least 0.21) of httplib2 to the directory listed after "Location: " in the pip show httplib2 output. Then I just did:这应该将 httplib2 的最新版本(至少 0.21)安装到pip show httplib2 output 中“位置:”之后列出的目录中。然后我就这样做了:

sudo rm -rf /usr/lib/python3/dist-packages/httplib2*
sudo cp -r <location>/httplib2* /usr/lib/python3/dist-packages/

After this, I could run sudo apt upgrade without errors.在此之后,我可以毫无错误地运行sudo apt upgrade

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM