Debian 10을 Debian 11로 업그레이드
설명
이 문서에서는 OS를 Debian 10에서 Debian 11로 업그레이드하는 과정을 설명합니다.
업그레이드
경고
운영 체제를 업그레이드하기 전에 서버의 모든 데이터를 전 체 백업할 것을 강력히 권장합니다. 이렇게 하면 문제가 발생했을 때를 대비한 안전장치가 되어, 비상 상황에서 시스템을 복원할 수 있습니다.
중요
OS 업그레이드 중의 모든 명령은 root 사용자로 서버 터미널에서 실행합니다.
구성 파일을 교체하라는 시스템 제안은 거부하십시오(기본 동작).
사용 중인 OS의 /etc/apt/sources.list.d에 있는 리포지토리 파일 이름은 이 안내에서 사용된 이름과 다를 수 있습니다.
/etc/apt/sources.list에 올바른 리포지토리가 있는지 확인하십시오. Debian 9용 리포지토리 목록은 아래에서 확인할 수 있습니다.
Debian 10 리포지토리
deb http://archive.debian.org/debian/ buster main contrib non-free
deb-src http://archive.debian.org/debian/ buster main contrib non-free
deb http://archive.debian.org/debian/ buster-updates main contrib non-free
deb-src http://archive.debian.org/debian/ buster-updates main contrib non-free
deb http://archive.debian.org/debian-security buster/updates main contrib non-free
deb-src http://archive.debian.org/debian-security buster/updates main contrib non-free
- 현재의 모든 패키지를 최신 버전으로 업데이트합니다
apt update && apt dist-upgrade
/etc/apt/sources.list의 리포지토리 목록을 Debian 11의 것으로 교체합니다. Debian 11용 리포지토리 목록은 아래에서 확인할 수 있습니다.
Debian 11 리포지토리
deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye main contrib non-free
deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free
- 발생할 수 있는 proftpd 업데이트 오류를 해결합니다
sed -e 's/^IdentLookups/#IdentLookups/' -i /etc/proftpd/proftpd.conf
- 패키지를 업데이트합니다. 다음 명령을 한 번에 하나씩 실행합니다
apt update
apt upgrade
apt dist-upgrade
- 다른 리포지토리를 업데이트합니다
sed -i 's|buster|bullseye|g' /etc/apt/sources.list.d/*.list
- nginx 리포지토리 키 추가
wget -q -O - http://nginx.org/keys/nginx_signing.key |apt-key add -
중요
Debian 11 리포지토리에는 이전 버전의 데이터베이스 서버가 없습니다. 계속 업그레이드하려면 /etc/apt/sources.list.d/에서 MySQL과 MariaDB의 버전을 각각 8.0과 10.5로 지정해야 합니다. 현재 데이터베이스 서버 버전은 다음 명령을 실행하여 확인할 수 있습니다
mysql -V
MySQL을 사용하는 경우 패키지 버전을 변경하고 리포지토리 키를 추가하십시오:
sed -i 's/mysql-5.7/mysql-8.0/g' /etc/apt/sources.list.d/mysql.list
wget -q -O - http://repo.mysql.com/RPM-GPG-KEY-mysql |apt-key add -
10.5 미만의 MariaDB에는 다 음을 사용하십시오:
sed -i 's/10.[0-4]/10.9/' /etc/apt/sources.list.d/mariadb.list
- 패키지를 업데이트합니다
apt update
apt dist-upgrade
- 기본 모듈, PHP7.3-FPM 및 Apache2 모듈과 함께 PHP 7.3을 설치합니다
dpkg -l | awk '/php7.3/ {print $2}' | sed -e 's/7.3/7.4/' | xargs apt install -y
apt 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 iconv json mbstring mysqli mysqlnd pdo pdo_mysql phar posix readline shmop simplexml sockets sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl opcache imagick memcached
- PHP-FPM 구성을 교체합니다
mv /opt/php74/etc/php-fpm.d/* /etc/php/7.4/fpm/pool.d/
rm /etc/php/7.3/fpm/pool.d/www.conf
mv /etc/php/7.3/fpm/pool.d/* /opt/php73/etc/php-fpm.d/
- PHP 7.3을 제거합니다
apt purge php7.3*
- PHP 7.4를 활성화합니다
a2enmod php7.4
- FASTPANEL base의 PHP 버전을 수정합니다
sqlite3 /usr/local/fastpanel2/app/db/fastpanel2.db "update site set php_version = 74 where mode = 'mpm_itk';"
- 메일 수신에 필요한 Dovecot 구성 요소를 설치합니다
apt install dovecot-lmtpd
- 서비스를 재구성합니다
mogwai services configure -f
- 사용 중인 데이터베이스 서버에 따른 추가 구성
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
- 서버를 다시 시작합니다
reboot
- 재부팅 후 모든 서비스가 시작되었는지 확인합니다
systemctl --failed
업그레이드가 완료되었습니다.