메인 콘텐츠로 건너뛰기

Debian 11을 Debian 12로 업그레이드

설명

이 문서에서는 OS를 Debian 11에서 Debian 12로 업그레이드하는 과정을 설명합니다.

업그레이드

경고

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

중요

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

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

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

  1. /etc/apt/sources.list에 올바른 리포지토리가 있는지 확인합니다 . 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
  1. 현재의 모든 패키지를 최신 버전으로 업데이트합니다
apt update && apt dist-upgrade
  1. /etc/apt/sources.list의 리포지토리 목록을 Debian 12의 리포지토리로 교체합니다. Debian 12용 리포지토리 목록은 아래에서 확인할 수 있습니다.
Debian 12 리포지토리
deb http://deb.debian.org/debian/ bookworm main contrib non-free
deb-src http://deb.debian.org/debian/ bookworm main contrib non-free

deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free
deb-src http://deb.debian.org/debian/ bookworm-updates main contrib non-free

deb http://deb.debian.org/debian-security bookworm-security main contrib non-free
deb-src http://deb.debian.org/debian-security bookworm-security main contrib non-free
  1. 발생 가능한 apache2 업그레이드 오류 해결
a2dismod php7.4
  1. 패키지를 업데이트합니다. 다음 명령을 한 번에 하나씩 실행합니다
apt update
apt upgrade
apt dist-upgrade
  1. 기타 리포지토리 업데이트
sed -i 's|bullseye|bookworm|g' /etc/apt/sources.list.d/*.list
  1. nginx 리포지토리 키 추가
wget -q -O - http://nginx.org/keys/nginx_signing.key |apt-key add -
중요

서버에서 MariaDB를 사용하는 경우, 최소 10.11 버전을 지정하도록 리포지토리를 수정해야 합니다.

다음 명령을 실행하여 사용 중인 데이터베이스 서버 버전을 확인할 수 있습니다

mysql -V

MySQL을 사용하는 경우 리포지토리를 수정하고, 해당 키를 업데이트한 다음 Debian 11 보안 리포지토리를 추가합니다:

sed -i 's|bookworm|bullseye|g' /etc/apt/sources.list.d/mysql.list
echo "deb http://security.debian.org/debian-security bullseye-security main" > /etc/apt/sources.list.d/bullseye-security.list
wget -q -O - http://repo.mysql.com/RPM-GPG-KEY-mysql |apt-key add -

10.5 미만의 MariaDB에는 다음을 사용합니다:

sed 's/10.[0-9]/11.1/' /etc/apt/sources.list.d/mariadb.list
  1. 패키지 업데이트
apt update
apt dist-upgrade
  1. 기본 모듈, PHP7.3-FPM 및 Apache2 모듈과 함께 PHP 8.2 설치
apt install -f php php-fpm libapache2-mod-php libapache2-mod-php8.2 php-common php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-gd php8.2-mbstring php8.2-mysql php8.2-opcache php8.2-readline php8.2-xml php8.2-xmlrpc php-imagick php-memcached

phpenmod calendar ctype curl dom exif fileinfo ftp gd gettext 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/php82/etc/php-fpm.d/* /etc/php/8.2/fpm/pool.d/

rm /etc/php/7.4/fpm/pool.d/www.conf

mv /etc/php/7.4/fpm/pool.d/* /opt/php74/etc/php-fpm.d/
  1. PHP 7.4 교체
apt-get purge php7.4*
  1. PHP 8.2 활성화
a2enmod php8.2
  1. FASTPANEL 베이스의 PHP 버전 수정
sqlite3 /usr/local/fastpanel2/app/db/fastpanel2.db "update site set php_version = 82 where mode = 'mpm_itk';"
  1. 메일 수신에 필요한 Dovecot 구성 요소 설치
apt install dovecot-lmtpd
  1. 서비스 재구성
mogwai services configure -f
  1. 사용 중인 데이터베이스 서버에 따른 추가 구성

MariaDB의 경우 - mysql_upgrade 실행

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

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