CentOS 7でhttpdを再インストールするときにエラーが発生しました。どうすれば解決できますか?

CentOS 7でhttpdを再インストールするときにエラーが発生しました。どうすれば解決できますか?

CentOS 7サーバーでhttpdを再インストールしようとするとエラーが発生します。 このエラーを解決してhttpdを再起動して実行するにはどうすればよいですか?

httpdをインストールしようとしたときに表示される最初のエラーは次のとおりです。

[root@server-ip-address conf]# yum install httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.chkhosting.com
 * epel: mirror.nexcess.net
 * extras: ftpmirror.your.org
 * updates: mirror.team-cymru.org
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-18.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-18.el7.centos for package: httpd-2.4.6-18.el7.centos.x86_64
--> Finished Dependency Resolution
Error: Package: httpd-2.4.6-18.el7.centos.x86_64 (updates)
       Requires: httpd-tools = 2.4.6-18.el7.centos
       Installed: 1:httpd-tools-2.4.6-18.el7.centos.vm.1.x86_64 (@virtualmin)
           httpd-tools = 1:2.4.6-18.el7.centos.vm.1
       Available: httpd-tools-2.4.6-17.el7.centos.1.x86_64 (base)
           httpd-tools = 2.4.6-17.el7.centos.1
       Available: httpd-tools-2.4.6-18.el7.centos.x86_64 (updates)
           httpd-tools = 2.4.6-18.el7.centos
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

--skip-brokenそれで、提案に従って以下を追加してみました。

[root@server-ip-address conf]# yum install httpd --skip-broken
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.chkhosting.com
 * epel: mirror.nexcess.net
 * extras: ftpmirror.your.org
 * updates: centos.mbni.med.umich.edu
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-18.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-18.el7.centos for package: httpd-2.4.6-18.el7.centos.x86_64
Packages skipped because of dependency problems:
    httpd-2.4.6-18.el7.centos.x86_64 from updates

その後、サービスを開始しようとしましたが、次のエラーが発生しました。

[root@server-ip-address conf]# systemctl start httpd.service
Failed to issue method call: Unit httpd.service failed to load: No such file or directory.

ベストアンサー1

あなたのバージョンがクラッシュし、httpd-tools公式のCentOSリポジトリではなくソースからインポートされたようです。まず削除してください。

 # rpm -e httpd-tools

これに関する静的情報を提供する場合は、準拠するまでおよび--force/または追加してください。--nodeps

以降をインストールするときは、必ずhttpdインストールしてくださいhttpd-tools

おすすめ記事