้กฏ็คบๅ…ทๆœ‰ yum ๆจ™็ฑค็š„ๆ–‡็ซ 。 ้กฏ็คบๆ‰€ๆœ‰ๆ–‡็ซ 
้กฏ็คบๅ…ทๆœ‰ yum ๆจ™็ฑค็š„ๆ–‡็ซ 。 ้กฏ็คบๆ‰€ๆœ‰ๆ–‡็ซ 

2019/12/30

yum ๅฅ—ไปถ็ฎก็†

ๆˆ‘ๅœจ้€™็ฏ‡ๆ–‡็ซ ๅฏซ้Ž yum ่ทŸ apt ็š„ไฝฟ็”จๅทฎ็•ฐๆฏ”่ผƒ,้€™็ฏ‡ไพ†่จŽ่ซ–ไธ€ไธ‹ yum ๅฐๆ–ผ repo ็š„็ฎก็†ๆ–นๅผ,้›–็„ถๅพˆๅคšๆ–น้ข centos ้ƒฝๆฏ” ubuntu ้บป็…ฉ่จฑๅคš,ไฝ† centos ็š„ yum ๅœจๆŸไบ›ๆ–น้ขๅฐๆ–ผ repo ็š„็ฎก็†ๆ›ดๅŠ ็š„ๆ–นไพฟ。

้ฆ–ๅ…ˆ,ๅฆ‚ๆžœไฝ ๆฒ’ๆœ‰้€™ๅ€‹ๆŒ‡ไปค,่ซ‹ๅ…ˆ้€้Ž yum ๅฎ‰่ฃ,yum -y install yum-utils,ไธ€่ˆฌๆˆ‘ๅ€‘ๆœƒ้€™ๆจฃๆ“ไฝœ。

$ yum repolist all # ๆŸฅ่ฉขๆœ‰ๅ“ชไบ› repo
$ yum repolist enabled # ๅ“ชไบ› repo ๆœ‰ๅ•Ÿ็”จ
$ yum repolist disabled # ๅ“ชไบ› repo ๆฒ’ๆœ‰ๅ•Ÿ็”จ

ไปŠๅคฉๅ‡่จญๆˆ‘็š„ๆœฌๆฉŸ้›ป่…ฆ PHP ็‰ˆๆœฌๆ˜ฏ 7.1,ๆˆ‘ๆœ‰ๅฎ‰่ฃ 7.3 ็š„ repo,ๆˆ‘่ฆๆ›ดๆ›็‰ˆๆœฌๅˆฐ 7.3 ็š„่ฉฑๆŒ‡ไปคๅฆ‚ไธ‹:

$ sudo yum-config-manager --disable remi-php71
$ sudo yum-config-manager --enable remi-php73
$ sudu yum install php
$ php -v
PHP 7.3.13 (cli) (built: Dec 17 2019 10:29:15) ( NTS )

ๆ‰“ๅฎŒๆ”ถๅทฅ,่‡ณๆ–ผ repo ๆ€Ž้บผๅฎ‰่ฃๅช่ฆๆ‰“ไธŠ่ฆ่ฃ็š„ package ๅŠ ไธŠ yum repo ็ญ‰้—œ้ตๅญ—ๅนพไนŽ้ƒฝๆ‰พ็š„ๅˆฐ。

ๅฆ‚ๆžœไฝ ไธๆƒณ้€้Ž config ่จญๅฎš,ๆƒณๅœจ runtime ็š„ๆ™‚ๅ€™ๆŒ‡ๅฎš repo,ๅคงๆฆ‚ๆต็จ‹ๅฆ‚ไธ‹:

$ sudo yum repolist all | grep php

remi-php54                          Remi's PHP 5.4 RPM repositor disabled
remi-php55                          Remi's PHP 5.5 RPM repositor disabled
remi-php55-debuginfo/x86_64         Remi's PHP 5.5 RPM repositor disabled
remi-php56                          Remi's PHP 5.6 RPM repositor disabled
remi-php56-debuginfo/x86_64         Remi's PHP 5.6 RPM repositor disabled
remi-php70                          Remi's PHP 7.0 RPM repositor disabled
remi-php70-debuginfo/x86_64         Remi's PHP 7.0 RPM repositor disabled
remi-php70-test                     Remi's PHP 7.0 test RPM repo disabled
remi-php70-test-debuginfo/x86_64    Remi's PHP 7.0 test RPM repo disabled
remi-php71                          Remi's PHP 7.1 RPM repositor disabled
remi-php71-debuginfo/x86_64         Remi's PHP 7.1 RPM repositor disabled
remi-php71-test                     Remi's PHP 7.1 test RPM repo disabled
remi-php71-test-debuginfo/x86_64    Remi's PHP 7.1 test RPM repo disabled
remi-php72                          Remi's PHP 7.2 RPM repositor disabled
remi-php72-debuginfo/x86_64         Remi's PHP 7.2 RPM repositor disabled
remi-php72-test                     Remi's PHP 7.2 test RPM repo disabled
remi-php72-test-debuginfo/x86_64    Remi's PHP 7.2 test RPM repo disabled
remi-php73                          Remi's PHP 7.3 RPM repositor disabled
remi-php73-debuginfo/x86_64         Remi's PHP 7.3 RPM repositor disabled
remi-php73-test                     Remi's PHP 7.3 test RPM repo disabled
remi-php73-test-debuginfo/x86_64    Remi's PHP 7.3 test RPM repo disabled
remi-php74                          Remi's PHP 7.4 RPM repositor disabled
remi-php74-debuginfo/x86_64         Remi's PHP 7.4 RPM repositor disabled
remi-php74-test                     Remi's PHP 7.4 test RPM repo disabled
remi-php74-test-debuginfo/x86_64    Remi's PHP 7.4 test RPM repo disabled
remi-php80                          Remi's PHP 8.0 RPM repositor disabled
remi-php80-debuginfo/x86_64         Remi's PHP 8.0 RPM repositor disabled
remi-php80-test                     Remi's PHP 8.0 test RPM repo disabled
remi-php80-test-debuginfo/x86_64    Remi's PHP 8.0 test RPM repo disabled

# ้€้ŽไธŠๆ–นๆ‰พๅˆฐไบ†ไฝ ๆƒณ่ฆ่ฃ็š„็‰ˆๆœฌ,็จ็ซ‹ enable repo ไป–
$ sudo yum install --enablerepo=remi-php74 php