![CentOS에 PHP 패키지를 설치할 수 없습니다](https://linux55.com/image/44939/CentOS%EC%97%90%20PHP%20%ED%8C%A8%ED%82%A4%EC%A7%80%EB%A5%BC%20%EC%84%A4%EC%B9%98%ED%95%A0%20%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4.png)
CentOS 6.3(편집하다:6.4로 업데이트) PHP(MySQL 및 기타 여러 패키지)를 설치할 수 없습니다.
예를 들어 출력은 다음 yum install php-devel
과 같습니다.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.vit.com.tr
* extras: mirrors.prometeus.net
* rpmforge: mirror.nl.leaseweb.net
* updates: mirrors.prometeus.net
Setting up Install Process
No package php-devel available.
Error: Nothing to do
출력 ls /etc/yum.repos.d
:
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo mirrors-rpmforge rpmforge.repo
grep -E "name|enabled" /etc/yum.repos.d/*
:
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Base
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Updates
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Extras
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Plus
/etc/yum.repos.d/CentOS-Base.repo:enabled=0
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Contrib
/etc/yum.repos.d/CentOS-Base.repo:enabled=0
/etc/yum.repos.d/CentOS-Debuginfo.repo:name=CentOS-6 - Debuginfo
/etc/yum.repos.d/CentOS-Debuginfo.repo:enabled=0
/etc/yum.repos.d/CentOS-Media.repo:name=CentOS-$releasever - Media
/etc/yum.repos.d/CentOS-Media.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Base
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Updates
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Extras
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Contrib
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - CentOSPlus
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Base
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Updates
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Extras
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Contrib
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - CentOSPlus
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Base
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Updates
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Extras
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Contrib
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - CentOSPlus
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/rpmforge.repo:name = Red Hat Enterprise $releasever - RPMforge.net - dag
/etc/yum.repos.d/rpmforge.repo:enabled = 1
yum repolist
:
repo id repo name status
base CentOS-6 - Base 6,296+85
extras CentOS-6 - Extras 13
rpmforge Red Hat Enterprise 6 - RPMforge.net - dag 11,131+144
updates CentOS-6 - Updates 890+34
yum list available 'php-*'
:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.vit.com.tr
* extras: mirrors.prometeus.net
* rpmforge: www.mirrorservice.org
* updates: mirrors.prometeus.net
Error: No matching Packages to list
이는 모든 PHP 패키지에서 발생합니다. 입력 php-
하고 Tab 키를 누르면 자동 완성이 되지 않습니다. 어떤 제안이 있으십니까?
답변1
일부 소프트웨어(예: cpanel)는 PHP를 비활성화합니다./etc/yum.conf
exclude= php* mysql*
/etc/yum.conf 파일에 위 줄이 포함되어 있으면 해당 줄에서 php*를 제거하면 php를 설치할 수 있습니다 :)
답변2
질문과 출력에 따르면 RPMForge 저장소만 활성화되어 있고 그 이상은 없는 것 같습니다.
/etc/yum.repos.d/rpmforge.repo:name = Red Hat Enterprise $releasever - RPMforge.net - dag
/etc/yum.repos.d/rpmforge.repo:enabled = 1
따라서 다음을 실행하십시오.
# yum repolist disabled
repo id repo name
fedora/19/x86_64 Fedora 19 - x86_64
fedora-debuginfo/19/x86_64 Fedora 19 - x86_64 - Debug
fedora-source/19/x86_64 Fedora 19 - Source
updates-debuginfo/19/x86_64 Fedora 19 - x86_64 - Updates - Debug
updates-testing/19/x86_64 Fedora 19 - x86_64 - Test Updates
updates-testing-debuginfo/19/x86_64 Fedora 19 - x86_64 - Test Updates Debug
updates-testing-source/19/x86_64 Fedora 19 - Test Updates Source
이제 필요한 저장소를 활성화하십시오:
yum-config-manager --enable fedora-source
귀하의 경우에는base
답변3
배쉬 완료
yum
기본적으로 키를 누를 때 자동 완성이 수행된다고 생각하지 않습니다 tab. 저는 다음과 같은 제목의 U&L Q&A를 찾았습니다.CentOS 6의 Yum에는 bash 완성 패키지가 없습니다., 이 패키지를 설치해야 할 것 같습니다 bash-completion
.
$ sudo yum install bash-completion
재연마
무슨 일이 일어나고 있는지 확인하기 위해 yum의 다른 기능 중 일부를 사용하겠습니다. 우선, yum이 알고 있는 저장소를 확인해 보세요:
$ yum repolist
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
repo id repo name status
Dropbox Dropbox Repository 4
adobe-linux-i386 Adobe Systems Incorporated 17
adobe-linux-x86_64 Adobe Systems Incorporated 2
fedora Fedora 14 - x86_64 22,161
google-chrome google-chrome 3
google-earth google-earth 1
google-talkplugin google-talkplugin 1
lamolabs LamoLabs Repo 58
lamolabs-noarch LamoLabs Repo 2
nautilus-flickr-uploader Nautilus Flickr Uploader for Fedora 14 3
rpmfusion-free RPM Fusion for Fedora 14 - Free 411
rpmfusion-free-updates RPM Fusion for Fedora 14 - Free - Updates 642
rpmfusion-nonfree RPM Fusion for Fedora 14 - Nonfree 181
rpmfusion-nonfree-updates RPM Fusion for Fedora 14 - Nonfree - Updates 282
scootersoftware Scooter Software 1
updates Fedora 14 - x86_64 - Updates 9,982
wuala cdn.wuala.com 8
사용 가능한 목록
또한 이 명령을 사용하여 액세스 권한이 있는 저장소에서 사용 가능한 항목을 확인할 수도 있습니다.
$ yum list available 'php-*'
php-mapi.x86_64 7.0.3-1.fc14 updates
php-mapserver.x86_64 5.6.7-1.fc14 updates
php-markdown.noarch 1.0.1n-1.fc14 fedora·
php-mbstring.x86_64 5.3.8-3.fc14 updates
php-mcrypt.x86_64 5.3.8-3.fc14 updates
php-mssql.x86_64 5.3.8-3.fc14 updates
php-mysql.x86_64 5.3.8-3.fc14 updates
php-nusoap.noarch 0.9.5-1.fc14 fedora·
php-oauth.noarch 1.0-0.7.svn592.fc12 fedora·
php-odbc.x86_64 5.3.8-3.fc14 updates
...
찾다
다음 명령을 사용하여 저장소를 검색할 수도 있습니다.
$ yum search 'php-devel'
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
============================== Matched: php-devel ==============================
php-devel.x86_64 : Files needed for building PHP extensions
php-devel.i686 : Files needed for building PHP extensions
ice-php-devel.i686 : Tools for developing Ice applications in PHP
ice-php-devel.x86_64 : Tools for developing Ice applications in PHP
다시 찾아봐
특정 패키지를 제공하는 저장소를 찾기 위해 저장소에 액세스할 수 있는 경우 다음 도구를 사용할 수 있습니다.
$ repoquery php-devel
php-devel-0:5.3.3-22.el6.x86_64
$ repoquery -i php-devel
Name : php-devel
Version : 5.3.3
Release : 22.el6
Architecture: x86_64
Size : 3188116
Packager : CentOS BuildSystem <http://bugs.centos.org>
Group : Development/Libraries
URL : http://www.php.net/
Repository : base
Summary : Files needed for building PHP extensions
Source : php-5.3.3-22.el6.src.rpm
Description :
The php-devel package contains the files needed for building PHP
extensions. If you need to compile your own PHP extensions, you will
need to install this package.
위에서 패키지가 php-devel
저장소에서 나오는 것을 볼 수 있습니다 base
.
가장 빠른 거울
때때로 이 플러그인으로 인해 문제가 발생할 수 있습니다. 사용하려는 이미지의 캐시를 삭제하여 재구축할 수 있습니다.
$ locate timedhosts.txt
/var/cache/yum/x86_64/6/timedhosts.txt
$ sudo rm /var/cache/yum/x86_64/6/timedhosts.txt
그런 다음 yum install php-devel 명령을 다시 실행하십시오.
말 수가 많은
위에 언급된 대부분의 명령은 스위치 --verbose
또는 와 함께 사용할 수 있습니다 -v
. 예를 들어, 다음 명령을 실행하면 실제로 뒤에서 무슨 일이 일어나고 있는지 yum list available <pkg>
에 대한 통찰력을 얻을 수 있습니다 .yum
$ yum --verbose list available php-devel
Loading "fastestmirror" plugin
Loading "priorities" plugin
Loading "refresh-packagekit" plugin
Config time: 0.020
Yum Version: 3.2.29
Setting up Package Sacks
Loading mirror speeds from cached hostfile
* base: mirror.thelinuxfix.com
* epel: mirror.steadfast.net
* extras: yum.singlehop.com
* updates: ftpmirror.your.org
--> python-netaddr-0.7.5-4.el6.noarch from base excluded (priority)
--> python-tw-forms-0.9.9-1.el6.noarch from base excluded (priority)
...
...
--> wxGTK-devel-2.8.12-1.el6.centos.x86_64 from extras excluded (priority)
73 packages excluded due to repository priority protections
pkgsack time: 6.174
rpmdb time: 0.000
Available Packages
php-devel.x86_64 5.3.3-22.el6 base
기본 저장소가 비활성화되었나요?
실행한 명령의 출력을 보면 기본 리포지토리가 비활성화되어( /etc/yum.repos.d/CentOS-Base.repo:enabled=0
) 활성화되어야 하는 것으로 나타납니다.
이러한 파일을 편집하고 줄을 0에서 1로 변경하거나 다음 명령을 실행할 수 있습니다.
$ yum-config-manager --enable base
$ yum-config-manager --enable updates
모든 저장소 활성화
다음 명령을 사용하여 모든 저장소를 활성화해 볼 수도 있습니다.
$ yum --enablerepo=\* search php-devel