System/CentOS | Ubuntu

[CentOS] 6 -> 7 업그레이드

jykim23 2021. 4. 13. 16:32

## 사전 준비

 

업데이트(추천)

# yum update

# reboot

리부트 후 버전 확인# cat /etc/redhat-release

CentOS release 6.10 (Final)

 

# pvdisplay  -> 제거할 pv 확인

 

업그레이드 툴을 다운 받기 위해 repo 생성

-> 패키지를 수동으로 다운받아 사용하려면 생략

# vi /etc/yum.repos.d/upgradetool.repo

[upg]

name=CentOS-$releasever - Upgrade Tool

baseurl=https://buildlogs.centos.org/centos/6/upg/x86_64/

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

리포 설정

 

 

 

 

## 업그레이드 사전 테스트

 

설치 테스트

# yum install redhat-upgrade-tool preupgrade-assistant-contents

# preupg

CentOS 7  GPG key 임포트

# rpm --import http://centos.mirror.cdnetworks.com/7/os/x86_64/RPM-GPG-KEY-CentOS-7

  centos7 rpm 파일들을 설치하기위해서는 RPM 서명 검증용 키를 설치해야 한다.

 

 

## openscap error

-> preupg에 필요한 openscap의 버전이 안맞는 경우에 발생한다.

설치되어 있는 openscap을 삭제하고 호환되는 버전으로 설치한다.

-> 호환되는 패키지를 다운받아 설치

더보기

에러 예시

 

 

## 업그레이드 실행

Upgrade 실행

# redhat-upgrade-tool

혹은

# centos-upgrade-tool

사용한 명령어

# redhat-upgrade-tool-cli --network 7 --cleanup-post --instrepo=http://vault.centos.org/centos/7.2.1511/os/x86_64/ --addrepo=CentOS7=http://mirror.centos.org/centos/7/os/x86_64/

http://vault.centos.org/centos/7.2.1511/os/x86_64/

완료 후 재부팅

업그레이드 진행으로 약간의 시간이 소요된다.

부팅 완료

부팅 시 sshd 가 실행되지 않아 원격 접속 불가

-> 콘솔 화면에서 sshd를 실행시킨다.

# systemctl enable sshd

  sshd

# systemctl start sshd

  sshd 실행

 

 

 

## Downloading failed: invalid in ~~ - error

 

운영체제 버전이 높아서 생기는 오류(추측)

-> 7(최신) -> 7.2로 낮추고 실행하여 해결

# redhat-upgrade-tool-cli --network 7 --cleanup-post --instrepo=http://vault.centos.org/centos/7.2.1511/os/x86_64/ --addrepo=CentOS7=http://mirror.centos.org/centos/7/os/x86_64/

http://vault.centos.org/centos/7.2.1511/os/x86_64/