1

我正在尝试将我的应用程序移动到曾经在 Amazon Linux 1 上运行的 Amazon Linux 2(AL2) ami 上运行。在尝试安装 python26-virtualenv 包的依赖项时,我收到此错误:

[root@ip-10-186-34-249 ec2-user]# yum install -y python26-virtualenv
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                 | 2.4 kB  00:00:00
epel/x86_64/metalink                                                                       |  15 kB  00:00:00
epel                                                                                       | 5.3 kB  00:00:00
epel-debuginfo/x86_64/metalink                                                             |  14 kB  00:00:00
epel-debuginfo                                                                             | 3.0 kB  00:00:00
epel-source/x86_64/metalink                                                                |  14 kB  00:00:00
epel-source                                                                                | 4.1 kB  00:00:00
(1/5): epel/x86_64/updateinfo                                                              | 976 kB  00:00:00
(2/5): epel-debuginfo/x86_64/primary_db                                                    | 899 kB  00:00:00
(3/5): epel/x86_64/primary_db                                                              | 6.7 MB  00:00:00
(4/5): epel-source/x86_64/updateinfo                                                       | 976 kB  00:00:00
(5/5): epel-source/x86_64/primary_db                                                       | 2.4 MB  00:00:00
182 packages excluded due to repository priority protections
No package python26-virtualenv available.
Error: Nothing to do

我使用以下命令在实例上启用了 epel repo:

sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum repolist all实例上的输出也如下:

[ec2-user@ip-10-186-34-249 ~]$ yum repolist all
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
228 packages excluded due to repository priority protections
repo id                               repo name                                                status
!amzn2-core/2/x86_64                  Amazon Linux 2 core repository                           enabled: 16,418+183
!amzn2-core-debuginfo/2/x86_64        Amazon Linux 2 core repository - debuginfo packages      enabled:   3,303+16
!amzn2-core-source/2                  Amazon Linux 2 core repository - source packages         enabled:          0
amzn2extra-docker/2/x86_64            Amazon Extras repo for docker                            enabled:         14
!amzn2extra-docker-debuginfo/2/x86_64 Amazon Extras debuginfo repo for docker                  disabled
amzn2extra-docker-source/2            Amazon Extras source repo for docker                     disabled
epel/x86_64                           Extra Packages for Enterprise Linux 7 - x86_64           enabled: 13,023+209
epel-debuginfo/x86_64                 Extra Packages for Enterprise Linux 7 - x86_64 - Debug   enabled:   2,862+47
epel-source/x86_64                    Extra Packages for Enterprise Linux 7 - x86_64 - Source  enabled:          0
epel-testing/x86_64                   Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
!epel-testing-debuginfo/x86_64        Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
epel-testing-source/x86_64            Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
repolist: 35,620

在不存在此问题的 Amazon Linux 1 机器上,我看到其他存储库存在于/etc/yum.repos.d/

[ec2-user@ip-10-150-135-107 ~]$ ls /etc/yum.repos.d/
amzn-main.repo     amzn-preview.repo  epel.repo
amzn-nosrc.repo    amzn-updates.repo  epel-testing.repo

虽然我可能错了,但我觉得如果我能以某种方式在我的新 AL2 实例上启用 amzn-main.repo,我将能够安装python26-virtualenv. 这可能吗?如果不是,请建议一种python26-virtualenv在我的 AL2 实例上安装的方法。

4

0 回答 0