我尝试按照本指南在我的系统上安装 Python 3.10。我运行了添加 PPA 的命令,执行了apt update,然后运行了apt install python3.10。
当我收到这条消息时,我感到非常惊讶:
Note, selecting 'postgresql-plpython3-10' for regex 'python3.10'
The following additional packages will be installed:
postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common
Suggested packages:
locales-all postgresql-doc-10
The following NEW packages will be installed:
postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common postgresql-plpython3-10
0 upgraded, 5 newly installed, 0 to remove and 60 not upgraded.
Need to get 4,958 kB of archives.
After this operation, 19.4 MB of additional disk space will be used.
Run Code Online (Sandbox Code Playgroud)
后来我意识到这是因为我在添加 PPA 时网络暂时掉线,随后操作失败。添加 PPA 解决了问题,现在我得到了正确的选项:
The following NEW packages will be installed:
libpython3.10-minimal libpython3.10-stdlib python3.10 python3.10-minimal
Run Code Online (Sandbox Code Playgroud)
结果的差异让我措手不及。考虑到我一生中超过 50% 的时间都在运行 Linux 发行版,被这样的事情打得措手不及感觉非常糟糕。运行完全相同的命令,我不再提供 Postgres。我非常担心它甚至首先提供了 Postgres。我过去曾帮助朋友安装 Ubuntu,文字墙让他们感到困惑和困惑,直到他们获得经验。我可以想象有人最终会在其系统上运行一个不安全的未受影响的数据库,等待用作攻击媒介。
我的问题是:
*)tho*_*ter 23
看来你在这个特定的例子中很不幸,因为“。” 在“python3.10”中触发了 apt 将其解释为正则表达式,然后它被解释为“任何字符”的代表,因此匹配“postgresql-plpython3-10”,而不匹配“python3.10” “因为该包暂时不可用。
在这种情况下,使用“python3\.10”可以解决这种情况,就像在 apt 告诉您它选择了什么并询问您是否要继续时取消一样。
看起来你无法在指定包名称时关闭 apt 对正则表达式的支持,除非不使用特殊字符(或者如果使用则转义它们)。
apt-get 也有这种行为,并且 aptitude 支持它自己的表达式语法。
出现这种问题的部分原因是 Ubuntu 有一个带有“.”的软件包。在其名称中,这是有效的,但该字符也恰好是触发包名称被解释为正则表达式的字符。
| 归档时间: |
|
| 查看次数: |
4534 次 |
| 最近记录: |