GCP > Google Conpute Engineでyumを使えるようにする




# Google Conpute Engineでyumを使えるようにする


## installl yum

```
sudo su
apt-get install yum
apt-get install yum-utils
```

## 確認

```
yum repolist all
```


## add repository

### epel
sudo su
vi /etc/yum/repos.d/epel.repo

```shell-session:epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

```


vi /etc/yum/repos.d/remi.repo

### remi

```shell-session:remi.repo
# Repository: http://rpms.remirepo.net/
# Blog:       http://blog.remirepo.net/
# Forum:      http://forum.remirepo.net/

[remi]
name=Remi's RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/remi/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/remi/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/remi/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-debuginfo]
name=Remi's RPM repository for Enterprise Linux 7 - $basearch - debuginfo
baseurl=http://rpms.remirepo.net/enterprise/7/debug-remi/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-test]
name=Remi's test RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/test/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/test/mirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/test/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi


[remi-test-debuginfo]
name=Remi's test RPM repository for Enterprise Linux 7 - $basearch - debuginfo
baseurl=http://rpms.remirepo.net/enterprise/7/debug-test/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

```


## 3.有効にする


```
yum-config-manager --enable epel-debuginfo
yum-config-manager --enable epel-source
yum-config-manager --enable remi
yum-config-manager --enable remi-debuginfo
```


```
# yum repolist all
remi                                                                                        | 2.9 kB  00:00:00     
remi/primary_db                                                                             | 2.0 MB  00:00:00     
remi-debuginfo                                                                              | 2.9 kB  00:00:00     
remi-debuginfo/primary_db                                                                   | 379 kB  00:00:01     
repo id                repo name                                                                    status
epel                   Extra Packages for Enterprise Linux 7 - x86_64                               enabled: 12,401
epel-debuginfo         Extra Packages for Enterprise Linux 7 - x86_64 - Debug                       enabled:  2,734
epel-source            Extra Packages for Enterprise Linux 7 - x86_64 - Source                      enabled:      0
remi                   Remi's RPM repository for Enterprise Linux 7 - x86_64                        enabled:  4,739
remi-debuginfo         Remi's RPM repository for Enterprise Linux 7 - x86_64 - debuginfo            enabled:  1,970
remi-php55             Remi's PHP 5.5 RPM repository for Enterprise Linux 7 - x86_64                disabled
remi-php55-debuginfo   Remi's PHP 5.5 RPM repository for Enterprise Linux 7 - x86_64 - debuginfo    disabled
```