메인 콘텐츠로 건너뛰기

Ubuntu 18을 Ubuntu 20으로 업그레이드

설명

이 문서에서는 OS를 Ubuntu 18.04에서 Ubuntu 20.04로 업그레이드하는 과정을 설명합니다.

업그레이드

경고

운영 체제를 업그레이드하기 전에 서버의 모든 데이터를 전체 백업할 것을 강력히 권장합니다. 이렇게 하면 문제가 발생할 경우를 대비한 안전장치가 되어, 긴급 상황에서 시스템을 복원할 수 있습니다.

중요

OS 업그레이드 중의 모든 명령은 root 사용자로 서버 터미널에서 실행합니다.

구성 파일 교체에 대한 시스템 제안은 거부하십시오(기본 동작).

사용 중인 OS의 /etc/apt/sources.list.d에 있는 리포지토리 파일 이름은 이 안내에서 사용된 이름과 다를 수 있습니다.

  1. /etc/apt/sources.list에 올바른 리포지토리가 있는지 확인하십시오. Ubuntu 18.04용 리포지토리 목록은 아래에서 확인할 수 있습니다.
Ubuntu 18 리포지토리
### Main repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse

### Updates repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse

### Security repo for Ubuntu bionic
deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse

### Backports repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

### Proposed repo for Ubuntu bionic
deb http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
  1. 현재 설치된 모든 패키지를 최신 버전으로 업데이트합니다
apt update && apt dist-upgrade
  1. 잠재적인 proftpd 및 apache2 업그레이드 오류 해결
a2dismod php7.2
sed -e 's/^IdentLookups/#IdentLookups/' -i /etc/proftpd/proftpd.conf
  1. mysql 구성에서 모든 query-cache 항목을 제거하고 mysql 리포지토리를 조정합니다:
sed -i 's/^query[_,-]cache[^ ]*//' /etc/mysql/my.cnf.fastpanel/99-fastpanel.cnf
  1. 업데이트를 실행합니다
do-release-upgrade --allow-third-party

어떤 이유로 유틸리티가 설치되어 있지 않은 경우, 다음 명령으로 해결할 수 있습니다

apt install update-manager-core
중요

확인하기 전에 유틸리티의 출력을 주의 깊게 읽고, 과정 중에 불필요한 항목이 삭제되지 않는지 확인하십시오.

시스템이 서버 재시작을 요청하면 업그레이드가 성공한 것으로 간주됩니다.

재부팅을 승인합니다

  1. 기본 모듈, PHP7.4-FPM 및 Apache2용 모듈과 함께 PHP 7.4를 설치합니다
apt-get install -f php php-fpm libapache2-mod-php libapache2-mod-php7.4 php-common php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-xmlrpc php-imagick php-memcached

phpenmod calendar ctype curl dom exif fileinfo ftp gd gettext json iconv mbstring mysqli mysqlnd pdo pdo_mysql phar posix readline shmop simplexml sockets sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlrpc xmlwriter xsl opcache imagick memcached
  1. PHP-FPM 구성을 교체합니다
mv /opt/php74/etc/php-fpm.d/* /etc/php/7.4/fpm/pool.d/
rm /etc/php/7.2/fpm/pool.d/www.conf
mv /etc/php/7.2/fpm/pool.d/* /etc/php/7.4/fpm/pool.d/
  1. FASTPANEL base의 PHP 버전을 수정합니다
sqlite3 /usr/local/fastpanel2/app/db/fastpanel2.db "update site set php_version = 74 where mode = 'mpm_itk';"
  1. 메일 수신에 필요한 Dovecot 구성 요소를 설치합니다
apt install dovecot-lmtpd
  1. 서비스를 재구성합니다
mogwai services configure -f
  1. 사용 중인 데이터베이스 서버에 따른 추가 구성

MySQL 8의 경우 - 호환성 설정을 추가합니다

echo 'disable-log-bin
mysqlx = OFF
default-authentication-plugin = mysql_native_password
character-set-server = utf8
collation-server = utf8_unicode_ci
' >> /etc/mysql/my.cnf.fastpanel/99-fastpanel.cnf

MariaDB의 경우 - mysql_upgrade를 실행합니다

mysql_upgrade
  1. 서버를 재시작합니다
reboot
  1. 재부팅 후 모든 서비스가 시작되었는지 확인합니다
systemctl --failed

업그레이드가 완료되었습니다.