AMH安装报错,DD安装的CentOS 7.6纯净版,请问这是什么问题,如何解决?

新手上路,请多包涵

报错信息如下:

[root@server ~]# sudo -i
[root@server ~]# export CV=[CN] DV=N && wget --no-check-certificate https://dl.amh.sh/amh.sh && bash amh.sh nginx-1.20,mysql-5.6,php-7.4
--2024-09-22 18:49:10-- https://dl.amh.sh/amh.sh
Resolving dl.amh.sh (dl.amh.sh)... 120.79.83.73, 2408:4003:1000:9aff:3c8f:27e6:888:b6bb
Connecting to dl.amh.sh (dl.amh.sh)|120.79.83.73|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12366 (12K) [application/octet-stream]
Saving to: ‘amh.sh.5’

100%[============================================================================================================================================================================================>] 12,366 --.-K/s in 0s

2024-09-22 18:49:10 (271 MB/s) - ‘amh.sh.5’ saved [12366/12366]

                               AMH-7.1                                  
                        Powered by amh.sh 2006-2023                     
                     https://amh.sh All Rights Reserved                  
                                                                        

==========================================================================
CentOS7 64Bit
Server ip
2*CPU, 3950MB/RAM, 1023MB/Swap

[Notice] AMH与MySQL初始账号密码:
admin: afca6f3dfdbf

root: afca6f3dfdbf

[Notice] 现在安装AMH-7.1吗?确认安装请输入y回车:y
[Notice] 即将安装AMH ...
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile

One of the configured repositories failed (未知),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&i... error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile

One of the configured repositories failed (未知),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&i... error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
systemctl: /usr/bin/systemctl /usr/share/man/man1/systemctl.1.gz
chronyc: /usr/bin/chronyc /usr/share/man/man1/chronyc.1.gz
506 Cannot talk to daemon
Start time: 2024年 09月 22日 星期日 18:49:13 CST
groupadd:“www”组已存在
useradd:用户“www”已存在
--2024-09-22 18:49:13-- https://dl.amh.sh/file/AMH/7.1/amh-conf-7.1.tar.gz
正在解析主机 dl.amh.sh (dl.amh.sh)... 120.79.83.73, 2408:4003:1000:9aff:3c8f:27e6:888:b6bb
正在连接 dl.amh.sh (dl.amh.sh)|120.79.83.73|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:5112 (5.0K) [application/octet-stream]
正在保存至: “amh-conf-7.1.tar.gz”

 0K ....                                                  100% 1.19G=0s

2024-09-22 18:49:13 (1.19 GB/s) - 已保存 “amh-conf-7.1.tar.gz” [5112/5112])

amh-conf-7.1/
amh-conf-7.1/conf/
amh-conf-7.1/conf/amh-base
amh-conf-7.1/conf/amh.c
amh.sh:行182: gcc: 未找到命令
chmod: 无法访问"/bin/amh": 没有那个文件或目录
amh.sh:行199: amh: 未找到命令
amh.sh:行200: amh: 未找到命令
amh.sh:行201: amh: 未找到命令
amh.sh:行202: amh: 未找到命令
amh.sh:行203: amh: 未找到命令
[Error] libiconv-1.14 download failed.
[Error] mysql-5.6 download failed.
[Error] nginx-1.20 download failed.
[Error] php-7.4 download failed.

[Error] amh-7.1 download failed.

抱歉。安装 AMH 失败了,

如有需要帮助安装,请联系我们: https://amh.sh/bbs/forum.htm

阅读 1.3k
avatarAI BotBETA

报错信息显示,主要问题集中在 CentOS 7 系统的 yum 仓库配置错误,以及系统缺少必要的编译工具如 gcc。以下是详细的解决步骤:

1. 解决 YUM 仓库问题

由于无法解析 mirrorlist.centos.org,这通常是因为 DNS 问题或仓库地址已变更。你可以尝试以下方法:

清理并重新生成缓存

sudo yum clean all
sudo yum makecache

检查并更新 /etc/resolv.conf

确保 /etc/resolv.conf 文件中包含正确的 DNS 服务器地址。通常,这个文件应该包含类似 nameserver 8.8.8.8nameserver 8.8.4.4(Google DNS)的行。

更换或更新 YUM 仓库地址

如果 CentOS 7 的官方仓库不再可用,你可能需要更改为其他可用的仓库。这通常涉及编辑 /etc/yum.repos.d/ 目录下的 .repo 文件,将仓库的 baseurlmirrorlist 指向新的地址。

2. 安装必要的编译工具

由于安装过程中提示找不到 gcc 命令,你需要安装这些必要的开发工具:

sudo yum install gcc gcc-c++ make

3. 重新运行 AMH 安装脚本

在解决了上述问题后,重新运行 AMH 安装脚本:

export CV=[CN] DV=N && wget --no-check-certificate https://dl.amh.sh/amh.sh && bash amh.sh nginx-1.20,mysql-5.6,php-7.4

4. 检查网络连接

确保服务器可以访问外部网络,特别是 AMH 仓库和 CentOS 仓库的服务器。

5. 查看日志和错误信息

如果问题仍然存在,检查 AMH 安装过程中的详细日志和错误信息,可能会提供更多线索。

6. 寻求帮助

如果以上步骤都无法解决问题,可以联系 AMH 的官方支持或在相关论坛上寻求帮助。

通过以上步骤,你应该能够解决 AMH 安装过程中的报错问题。

1 个回答

centos7官方已经停止维护,

一定要用centos7,可以试换阿里云的源,或其它还在线的系统软件源。

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all && yum makecache

新安装amh建议是用新版本的系统。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题