当我检查更新时,出现“无法下载存储库信息”错误。
这是详细信息下的内容:
W: Failed to fetch gzip:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_natty_main_source_Sources Hash Sum mismatch,
E: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud) 我在 ubuntu 16.4 上运行以下命令:
sudo add-apt-repository ppa:noobslab/apps
以下问题:
如何在 Ubuntu 16.04 上安装 PlayOnLinux
并得到以下错误:
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 27, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
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 30, in <module>
import apport.fileutils …Run Code Online (Sandbox Code Playgroud) 系统路径:
['/usr/lib/update-notifier', '/usr/local/lib/python26.zip', '/usr/local/lib/python2.6', '/usr/local/lib/python2.6/平台 linux3'、'/usr/local/lib/python2.6/lib-tk'、'/usr/local/lib/python2.6/lib-old'、'/usr/local/lib/python2.6 /lib-dynload', '/usr/local/lib/python2.6/site-packages']
terry@terrylaptop:/usr/lib$ sudo apt-get install python-debian
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-debian is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 239 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up update-notifier-common (0.119ubuntu8.6) ...
Traceback (most recent call last):
File "/usr/lib/update-notifier/package-data-downloader", line …Run Code Online (Sandbox Code Playgroud) 2 个多月后我打开了 Ubuntu 16.04,现在我收到安装任何软件包的错误(我尝试安装redshift软件包(夜间模式))。
ERROR E: Unable to locate package apt_pkg
Run Code Online (Sandbox Code Playgroud)
我尝试更新 Ubuntu,然后收到错误消息:
W: The repository 'http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found [IP: 91.189.95.83 80]
E: Some index files failed to download. They have been ignored, or old ones used …Run Code Online (Sandbox Code Playgroud) update-manager package-management gnome-terminal redshift 16.04
我可以将 WSL Ubuntu 18.04 上的默认 Python 3.6.5 更改为 3.7 吗?所以,当我检查python3 --version,我得到3.7.x这样我就可以使用该版本与PIP3为好。谢谢
我最近使用以下命令在 Ubuntu 18.04.4 LTS 机器上安装了 python 3.7:
sudo apt-get install python3.7
Run Code Online (Sandbox Code Playgroud)
我还运行了以下命令,因为我希望 python 3.7 运行为python3:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
Run Code Online (Sandbox Code Playgroud)
随后我按照一个建议来运行这个:
sudo apt autoremove
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试启用universe存储库 ( add-apt-repository universe) 时,出现以下错误:
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 28, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Run Code Online (Sandbox Code Playgroud)
我找到的大多数答案都告诉我python3-apt像这里和这里一样重新安装,但这不起作用。
我还能尝试什么?
我目前正在使用 WSL2。当我运行时,sudo apt update我得到以下输出和错误:
$ sudo apt update
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:4 https://cli.github.com/packages focal InRelease
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Fetched 324 kB in 1s (386 kB/s)
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 8, in <module>
from CommandNotFound.db.creator import DbCreator
File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success …Run Code Online (Sandbox Code Playgroud)