Debian 8.4에서 Nginx 서버를 1.10으로 업데이트

Debian 8.4에서 Nginx 서버를 1.10으로 업데이트

방금 가상 머신에 최신 Debian 버전(8.4)을 설치했는데 모든 것이 잘 진행되었습니다.

그런 다음 Debian 저장소에서 nginx 서버를 설치했고 버전 1.6.2를 얻었습니다. 사용 가능한 최신 버전은 1.10이므로 업데이트하고 싶습니다.

내가 시도한 방식이 틀렸을 수도 있지만 지금까지 내가 찾은 전부입니다.

먼저 다음과 같은 방법으로 파일에 nginx 저장소를 추가하여 저장소를 업데이트했습니다 sources.list.

sudo sh -c "echo 'deb http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list"
sudo sh -c "echo 'deb-src http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list"
curl http://nginx.org/keys/nginx_signing.key | apt-key add -
sudo apt-get update

그런 다음 다음 명령을 사용하여 최신 nginx 버전을 설치하려고 했습니다.

sudo apt-get install nginx

그리고 나는 이 문제를 얻습니다.

root@Debian:/#LANG=C apt-get install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
    nginx-common nginx-full
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
    nginx
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/739 kB of archives.
After this operation, 2421 kB of additional disk space will be used.
Reading changelogs... Done
(Reading database ... 140333 files and directories currently installed.)
Preparing to unpack .../nginx_1.10.0-1~jessie_i386.deb ...
Unpacking nginx (1.10.0-1~jessie) over (1.6.2-5+deb8u1) ...
dpkg: error processing archive /var/cache/apt/archives/nginx_1.10.0-1~jessie_i386.deb (--unpack): trying to overwrite '/etc/default/nginx', which is also in package nginx-common 1.6.2-5+deb8u1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
    /var/cache/apt/archives/nginx_1.10.0-1~jessie_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

이 문제를 어떻게 해결할 수 있나요?

답변1

기본적인 오류는 다음과 같습니다(강조).

dpkg: /var/cache/apt/archives/nginx_1.10.0-1~jessie_i386.deb 아카이브 처리 중 오류가 발생했습니다(--unpack):nginx-common 1.6.2-5+deb8u1 패키지에도 있는 '/etc/default/nginx'를 덮어쓰려고 합니다.

nginx-common이는 설치하려는 새 패키지가 다른 패키지(설치된 패키지 ) 에서 제공한 파일을 덮어쓰려고 시도하고 있으며 dpkg문제가 발생할 것을 두려워하여 이를 거부한다는 의미입니다.

간단한 해결책은 nginx-common패키지를 완전히 제거한 다음 새 버전을 다시 설치하는 것입니다.

sudo apt-get purge nginx-common
sudo apt-get install nginx

관련 정보