我的包裹系统被严重损坏了。所以我找到了另一个解决方案,
sudo apt-get build-dep <package>
但当我打字时sudo apt-get build-dep update-manager
,我得到了,
E: You must put some 'source' URIs in your sources.list
然后我使用 访问了它sudo nano /etc/apt/sources.list
。列表是空白的。现在我不确定如何添加更多源 URI。我无法访问软件更新程序来更改它。我试过 Synaptic 包管理器。
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python3 needs to be reinstalled, but I can't find an archive for it.
更新:
我已经使用编辑了 sources.list@karel 的回答在cat /etc/apt/sources.list 的正确输出是什么?并替换bionic
为cosmic
。
现在,当我尝试启动时software-properties-gtk
,我得到了:
bash: /usr/bin/software-properties-gtk: /usr/bin/python3: bad interpreter: Too many levels of symbolic links
python3 的符号链接的输出:
$ ls -l /usr/bin/python3
lrwxrwxrwx 1 root root 18 May 27 20:30 /usr/bin/python3 -> /usr/bin/python3.6
$ ls -l /usr/bin/python3.6
lrwxrwxrwx 1 root root 25 May 27 16:31 /usr/bin/python3.6 -> /etc/alternatives/python3
$ ls -l /etc/alternatives/python3
lrwxrwxrwx 1 root root 18 May 27 16:31 /etc/alternatives/python3 -> /usr/bin/python3.6
输出ls -l /usr/bin/python*
:
lrwxrwxrwx 1 root root 18 May 27 23:10 /usr/bin/python -> /usr/bin/python3.2
lrwxrwxrwx 1 root root 9 Jun 7 2018 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3691008 Apr 9 05:50 /usr/bin/python2.7
lrwxrwxrwx 1 root root 18 May 27 20:30 /usr/bin/python3 -> /usr/bin/python3.6
lrwxrwxrwx 1 root root 25 May 27 16:31 /usr/bin/python3.6 -> /etc/alternatives/python3
lrwxrwxrwx 1 root root 33 Apr 9 05:59 /usr/bin/python3.6-config -> x86_64-linux-gnu-python3.6-config
-rwxr-xr-x 1 root root 4530552 Apr 9 05:59 /usr/bin/python3.6m
lrwxrwxrwx 1 root root 34 Apr 9 05:59 /usr/bin/python3.6m-config -> x86_64-linux-gnu-python3.6m-config
-rwxr-xr-x 2 root root 4804160 Apr 9 05:56 /usr/bin/python3.7
-rwxr-xr-x 2 root root 4804160 Apr 9 05:56 /usr/bin/python3.7m
lrwxrwxrwx 1 root root 16 Oct 25 2018 /usr/bin/python3-config -> python3.6-config
lrwxrwxrwx 1 root root 10 Oct 25 2018 /usr/bin/python3m -> python3.6m
lrwxrwxrwx 1 root root 17 Oct 25 2018 /usr/bin/python3m-config -> python3.6m-config
答案1
今天你学到了一个宝贵的教训:在编辑文件之前请先备份文件。
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
如果把文件弄乱了,可以复制备份并重新开始:
sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list
需要考虑的事情:
/tmp
文件在重启时会被删除。备份时要小心/tmp
。- 请小心并确保备份文件不包含和泄露敏感信息。
要恢复sources.list
文件,您可以清空文件sources.list
,然后使用software-properties-gtk
它重新创建列表。有关此过程的详细信息,请参见在这个答案中,但您可以使用 GUI 取消选中并选中您想要的源。您至少需要“main”,并且可能还需要“universe”。启用这些后,请务必通过 更新您的数据库apt update
。