gcsfuse 无法在 centos-7 上安装

gcsfuse 无法在 centos-7 上安装

自 4 月 1 日星期四以来,我们在每天从基础 centos-7 映像启动的 GCP comoute VM 上遇到问题。

启动时启动脚本将使用此处列出的命令安装 gcsFuse: https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/installing.md#centos-and-red-hat-latest-releases

自最新版本以来,此安装方法现已失败:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                                                                                                           | 8.6 kB  00:00:00     
 * base: mirror.atl.genesisadaptive.com
 * epel: iad.mirror.rackspace.com
 * extras: mirrors.mit.edu
 * updates: mirrors.raystedman.org
base                                                                                                                                                                                                                           | 3.6 kB  00:00:00     
extras                                                                                                                                                                                                                         | 2.9 kB  00:00:00     
gcsfuse/signature                                                                                                                                                                                                              |  844 B  00:00:00     
Retrieving key from https://packages.cloud.google.com/yum/doc/yum-key.gpg
Retrieving key from https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
gcsfuse/signature                                                                                                                                                                                                              | 1.4 kB  00:00:00 !!! 
https://packages.cloud.google.com/yum/repos/gcsfuse-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for gcsfuse
Trying other mirror.

有人知道如何解决这个错误吗?

答案1

有一个快速解决方法,但这意味着跳过 GPG repo 密钥验证。我只是更改repo_gpgcheck=1repo_gpgcheck=0,其余部分保持原样。

最终脚本如下:

sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null <<EOF
[gcsfuse]
name=gcsfuse (packages.cloud.google.com)
baseurl=https://packages.cloud.google.com/yum/repos/gcsfuse-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF

结果如下:

[wb@instance-1 yum.repos.d]$ sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null <<EOF
> [gcsfuse]
> name=gcsfuse (packages.cloud.google.com)
> baseurl=https://packages.cloud.google.com/yum/repos/gcsfuse-el7-x86_64
> enabled=1
> gpgcheck=1
> repo_gpgcheck=0
> gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
>        https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
> EOF
[wb@instance-1 yum.repos.d]$ sudo yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: atl.mirrors.clouvider.net
 * epel: mirror.steadfastnet.com
 * extras: centos.mirrors.hoobly.com
 * updates: mirror.genesisadaptive.com
gcsfuse                                                                                  | 1.4 kB  00:00:00     
gcsfuse/primary                                                                          | 2.5 kB  00:00:00     
gcsfuse                                                                                                   16/16
No packages marked for update
[wb@instance-1 yum.repos.d]$ sudo yum install gcsfuse -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: atl.mirrors.clouvider.net
 * epel: mirror.steadfastnet.com
 * extras: centos.mirrors.hoobly.com
 * updates: mirror.genesisadaptive.com
Resolving Dependencies
--> Running transaction check
---> Package gcsfuse.x86_64 0:0.28.1-1 will be installed
--> Processing Dependency: fuse for package: gcsfuse-0.28.1-1.x86_64
--> Running transaction check
---> Package fuse.x86_64 0:2.9.2-11.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                  Arch                    Version                        Repository                Size
================================================================================================================
Installing:
 gcsfuse                  x86_64                  0.28.1-1                       gcsfuse                  4.0 M
Installing for dependencies:
 fuse                     x86_64                  2.9.2-11.el7                   base                      86 k

Transaction Summary
================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 4.1 M
Installed size: 12 M
Downloading packages:
(1/2): fuse-2.9.2-11.el7.x86_64.rpm                                                      |  86 kB  00:00:00     
(2/2): 4d9c7e630b6a8c14c6c054f5c23107be50e8d8a3b2707e6bef66ef6a236bb5c4-gcsfuse-0.28.1-1 | 4.0 MB  00:00:00     
----------------------------------------------------------------------------------------------------------------
Total                                                                           7.4 MB/s | 4.1 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : fuse-2.9.2-11.el7.x86_64                                                                     1/2 
  Installing : gcsfuse-0.28.1-1.x86_64                                                                      2/2 
  Verifying  : gcsfuse-0.28.1-1.x86_64                                                                      1/2 
  Verifying  : fuse-2.9.2-11.el7.x86_64                                                                     2/2 

Installed:
  gcsfuse.x86_64 0:0.28.1-1                                                                                     

Dependency Installed:
  fuse.x86_64 0:2.9.2-11.el7                                                                                    

Complete!

我刚刚在一台全新的虚拟机上测试了它,该虚拟机使用 CentOS 7 的默认设置。我还将它用作启动脚本并且它按预期工作。

讨论了类似的问题这里但这种方法对我来说不起作用。

相关内容