在 amazon-linux-2 EC2 实例上离线安装 rpm 包

问题描述 投票:0回答:1

我尝试通过上传其所有依赖项在未连接到互联网的 amazon-linux-2 EC2 实例上安装 rpm 包 (rstudio-server)。我主要遵循此处的说明。

使用 amazon-linux-2 docker 镜像

在我的本地计算机上,在 amazonlinux docker 映像中,我运行:

mkdir /var/tmp/rstudio-server
mkdir /var/tmp/rstudio-server-installroot
wget https://download2.rstudio.org/server/centos7/x86_64/rstudio-server-rhel-1.4.1106-x86_64.rpm
yum install --downloadonly --installroot=/var/tmp/rstudio-server-installroot/ --downloaddir=/var/tmp/rstudio-server rstudio-server-rhel-1.4.1106-x86_64.rpm --releasever latest

我收到此错误:

Loaded plugins: ovl, priorities
Repository 'amzn2-core': Error parsing config: Error parsing "mirrorlist = '$awsproto://$amazonlinux.$awsregion.$awsdomain/latest/$product/$target/x86_64/mirror.list'": URL must be http, ftp, file or https not ""
Repository 'amzn2-core-source': Error parsing config: Error parsing "mirrorlist = '$awsproto://$amazonlinux.$awsregion.$awsdomain/latest/$product/$target/SRPMS/mirror.list'": URL must be http, ftp, file or https not ""
Repository 'amzn2-core-debuginfo': Error parsing config: Error parsing "mirrorlist = '$awsproto://$amazonlinux.$awsregion.$awsdomain/latest/$product/$target/debuginfo/x86_64/mirror.list'": URL must be http, ftp, file or https not ""
Examining rstudio-server-rhel-1.4.1106-x86_64.rpm: rstudio-server-1.4.1106-1.x86_64
Marking rstudio-server-rhel-1.4.1106-x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rstudio-server.x86_64 0:1.4.1106-1 will be installed
--> Processing Dependency: sqlite for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: postgresql-libs for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: psmisc for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Processing Dependency: /bin/sh for package: rstudio-server-1.4.1106-1.x86_64
--> Finished Dependency Resolution
Error: Package: rstudio-server-1.4.1106-1.x86_64 (/rstudio-server-rhel-1.4.1106-x86_64)
           Requires: sqlite
Error: Package: rstudio-server-1.4.1106-1.x86_64 (/rstudio-server-rhel-1.4.1106-x86_64)
           Requires: /bin/sh
Error: Package: rstudio-server-1.4.1106-1.x86_64 (/rstudio-server-rhel-1.4.1106-x86_64)
           Requires: postgresql-libs
Error: Package: rstudio-server-1.4.1106-1.x86_64 (/rstudio-server-rhel-1.4.1106-x86_64)
           Requires: psmisc
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

如果我尝试在没有

--installroot
标志的情况下运行它,它只会创建另外两个 rpm 文件,
postgresql-libs
psmisc
。我假设这些是直接依赖项,但它不会安装二阶依赖项。尝试在依赖项上运行相同的命令没有任何作用。

使用 CentOS docker 镜像

如果我在 centos docker 镜像中尝试它,我可以构建存储库,但从另一端似乎不起作用。

mkdir /var/tmp/rstudio-server
mkdir /var/tmp/rstudio-server-installroot
wget https://download2.rstudio.org/server/centos7/x86_64/rstudio-server-rhel-1.4.1106-x86_64.rpm
yum install --downloadonly --installroot=/var/tmp/rstudio-server-installroot/ --downloaddir=/var/tmp/rstudio-server rstudio-server-rhel-1.4.1106-x86_64.rpm --releasever 8

这会在

/var/tmp/rstudio-server
下创建 167 个文件。

我将它们全部上传,以及原始的

rstudio-server
rpm 到远程计算机(通过一个特殊的 S3 存储桶进行病毒扫描并将其移动到另一个 S3 存储桶),然后将所有内容下载到亚马逊上的
/var/tmp/rstudio-server
-linux-2 EC2 机器。

然后我创建一个名为

/etc/yum.repos.d/offline-rstudio-server.repo
的文件,其中包含以下内容:

[offline-rstudioserver]
name=amazon-linux-2 - rstudioserver
baseurl=file:///var/tmp/rstudio-server
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2

然后我跑:

sudo yum --disablerepo=\* --enablerepo=offline-rstudioserver install /var/tmp/rstudio-server/rstudio-server-rhel-1.4.1106-x86_64.rpm

它给了我很多信息,例如:

--> Processing Dependency: libgnutils.so.28()(64bit) for package: neon-0.30.0-3.amzn2.0.2.x86_64

然后,许多消息如:

Error: Package: python3-libs-3.7.6-1.amzn2.0.1.x86_64 (@amzn2-core)
           Requires: libtirpc.so.1()(64bit)
           Removing: libtirpc-0.2.4-0.16.amzn2.x86_64 (@amzn2-core)
               libtirpc.so.1()(64bit)
           Updated by: libtirpc-1.1.4-4.el8.x86_64 (offline-rstudioserver)
              ~libtirpc.so.3()(64bit)

我假设这里的问题是我在 CentOS 机器上编译它并将其带到 amazon-linux-2 机器上,并且那里存在一些基本的不兼容性。

我正式陷入困境。有什么想法吗?

amazon-ec2 offline rpm yum rstudio-server
1个回答
0
投票

豪迪

在我看来,您的 amazon linux 安装提供的 libtirpc 版本高于您的离线存储库。通过 python3-libs 的依赖

由于您是离线工作并且不会从互联网获得冲突的更新,因此您可以尝试“让事情运行”,我不建议将此作为生产方法:P

rpm -e --justdb --nodeps libtirpc-0.2.4-0.16.amzn2.x86_64

这会产生从 rpm db 中删除该包的条目的效果,让 yum 感觉可以继续,但实际上不会从文件系统上的包中删除任何内容(如果有,可能会破坏东西)

可能还有其他依赖性,这可能会使事情变得复杂。祝你好运。

© www.soinside.com 2019 - 2024. All rights reserved.