Faythe Tech Blog for Information Security and Cyber Threat Intelligence

Ubuntu Update from 16.04 to 18.04 (우분투 업데이트)

2018년 4월쯤, Ubuntu가 18.04 LTS 버전을 업데이트했다. 버전이 16.04인 서버가 하나 놀고있어서, 업데이트도 할 겸 우분투를 업데이트하는 방법에 대해서 소개한다.

Package manager update and upgrade

먼저, 커널을 업데이트 하기 위해 우분투 패키지 매니저를 최신 버전으로 업데이트한다.

$ sudo apt update
$ sudo apt upgrade
$ sudo apt dist-upgrade

업데이트가 완료되면 시스템을 재부팅해서 변경사항이 로드될 수 있도록 하자.

$ sudo reboot

Ubuntu version upgrade

패키지 업데이트가 완료되면, 새로운 우분투 릴리즈에 대한 업데이트를 수행한다.

$ sudo apt install update-manager-code
$ sudo do-release-upgrade 

No new release found 라는 에러가 발생할 경우, 다음 명령어를 사용한다.

$ sudo do-release-upgrade -d

릴리즈 업그레이드를 실행하면 다음과 같은 화면이 나타난다.

Reading cache

Checking package manager

Continue running under SSH? 

This session appears to be running under ssh. It is not recommended 
to perform a upgrade over ssh currently because in case of failure it 
is harder to recover. 

If you continue, an additional ssh daemon will be started at port 
'1022'. 
Do you want to continue? 

Continue [yN]

만약 ssh로 접속하여 우분투 업데이트를 진행하는 경우, 중간에 업데이트에 실패할 경우 복구가 어려울 수 있다는 경고문이다. ssh로 업데이트하다가 중단될 경우에 대비해 1022번 포트에 새로운 ssh 데몬을 연결하겠다는 내용이다. 가능하다면 우분투 업그레이드는 직접 서버에 붙어서 수행하는 것을 추천한다.

y를 눌러 업데이트를 진행하면 다음과 같은 화면을 볼 수 있다.

Checking package manager
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Calculating the changes

Calculating the changes

Do you want to start the upgrade? 


54 installed packages are no longer supported by Canonical. You can 
still get support from the community. 

150 packages are going to be removed. 1,504 new packages are going to be 
installed. 396 packages are going to be upgraded. 

You have to download a total of 1,107 M. This download will take about 
2 minutes with your connection. 

Installing the upgrade can take several hours. Once the download has 
finished, the process cannot be canceled. 

 Continue [yN]  Details [d]

삭제되고 새롭게 설치되는 패키지들의 수는 서버마다 다를 수 있다. 긴 시간의 설치 후, 다음과 같은 화면을 볼 수 있다.

System upgrade is complete.

Restart required 

To finish the upgrade, a restart is required. 
If you select 'y' the system will be restarted. 

Continue [yN]

y를 누르면 서버가 재부팅되면서 우분투 18.04 버전이 설치 완료된다. 다음과 같이 업그레이드된 우분투 버전을 확인할 수 있다.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic