apt를 사용하여 설치 또는 업그레이드할 때 오류가 발생했습니다.

apt를 사용하여 설치 또는 업그레이드할 때 오류가 발생했습니다.

Debian 9를 10으로 업그레이드하려고 하는데 sudo apt-get update, sudo apt-get Upgrade 및 sudo apt-get full-upgrade를 실행하려고 하면 모두 다음과 같은 오류 메시지가 나타납니다.

    optiplex@optiplex:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-image-generic-lts-xenial : Depends: linux-firmware but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

나는 달리려고 노력한다

apt --fix-broken install

그런데 다음과 같은 오류 메시지가 나타났습니다.

 optiplex@optiplex:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  linux-image-4.9.0-8-amd64
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  linux-firmware
The following NEW packages will be installed:
  linux-firmware
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
3 not fully installed or removed.
Need to get 0 B/33.9 MB of archives.
After this operation, 127 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
  linux-firmware
Install these packages without verification? [y/N] y
(Reading database ... 514688 files and directories currently installed.)
Preparing to unpack .../linux-firmware_1.127.24_all.deb ...
Unpacking linux-firmware (1.127.24) ...
dpkg: error processing archive /var/cache/apt/archives/linux-firmware_1.127.24_all.deb (--unpack):
 trying to overwrite '/lib/firmware/cis/PE-200.cis', which is also in package firmware-linux-free 3.4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/linux-firmware_1.127.24_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

누구든지 이 문제를 해결하도록 도와줄 수 있나요?


편집하다:

GAD3R에서 제공한 지침을 보고 있지만 이번에는 apt로 작업을 시도할 때마다 약간 다른 오류 메시지가 표시됩니다.

    dpkg: error processing package snapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

편집 2:

최선을 다했지만 apt-get upgrade 계속 오류가 발생합니다.

... Selecting previously unselected package x11proto-dev.
Preparing to unpack .../513-x11proto-dev_2018.4-4_all.deb ...
Unpacking x11proto-dev (2018.4-4) ...
Preparing to unpack .../514-xbrlapi_5.6-10_amd64.deb ...
Unpacking xbrlapi (5.6-10) over (5.4-7+deb9u1) ...
Preparing to unpack .../515-xscreensaver-data_5.42+dfsg1-1_amd64.deb ...
Unpacking xscreensaver-data (5.42+dfsg1-1) over (5.36-1) ...
Preparing to unpack .../516-xscreensaver-gl_5.42+dfsg1-1_amd64.deb ...
Unpacking xscreensaver-gl (5.42+dfsg1-1) over (5.36-1) ...
Preparing to unpack .../517-xserver-xephyr_2%3a1.20.4-1_amd64.deb ...
Unpacking xserver-xephyr (2:1.20.4-1) over (2:1.19.2-1+deb9u5) ...
Preparing to unpack .../518-xterm_344-1_amd64.deb ...
Unpacking xterm (344-1) over (327-2) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-3w5XWy/270-libel-api-java_3.0.0-2_all.deb
 /tmp/apt-dpkg-install-3w5XWy/303-libjsp-api-java_2.3.4-2_all.deb
 /tmp/apt-dpkg-install-3w5XWy/361-libwebsocket-api-java_1.1-1_all.deb
 /tmp/apt-dpkg-install-3w5XWy/433-plymouth_0.9.4-1.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Optiplex 755 PC에서 Debian 9를 실행하고 있습니다.

시간 내 주셔서 감사합니다!

니콜라스.

답변1

데비안 9를 10으로 업그레이드하려면 다음이 필요합니다.오직다음 줄은/etc/apt/sources.list:

deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian-security/ buster/updates main
deb http://deb.debian.org/debian buster-updates main

디렉토리 아래의 타사 저장소를 비활성화합니다 /etc/apt/sources.list.d/.

귀하의 경우 ubuntu-xenial 저장소(패키지 제공 linux-image-generic-lts-xenial)를 활성화하면 시스템이 중단됩니다.

그런 다음 다음을 실행하십시오.

sudo apt update
sudo apt install linux-image-amd64
sudo apt upgrade
sudo apt dist-upgrade

말한 바와 같이@Stephenkitlinux-firmware_1.127.24_all.debUbuntu Trusty로 인해 발생하므로 error code (1)삭제해야 합니다 apt purge linux-firmware.

다음 오류를 해결합니다( post-removal스크립트).

Errors were encountered while processing:
/var/cache/apt/archives/linux-firmware_1.127.24_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

파일 을 편집 /var/lib/dpkg/info/linux-firmware.postrm하고 해당 내용을 다음으로 바꿉니다.

#!/bin/bash
/bin/true

다음 오류를 해결합니다( post-installation스크립트).

subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

다음과 같이 편집되었습니다 /var/lib/dpkg/info/snapd.postinst:

#!/bin/bash
/bin/true

고쳐 쓰다:

파일을 백업 /var/lib/dpkg/status하고 다음 으로 /var/lib/dpkg/status-old바꿉니다 .statusstatus-old

sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.bak1
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status-old.bak1
sudo mv /var/lib/dpkg/status-old /var/lib/dpkg/status

그런 다음 다음을 실행하십시오.

sudo dpkg --configure -a
sudo apt clean
sudo apt autoclean
sudo apt update 
sudo apt upgrade

답변2

좋아요,

resources.list 파일을 편집했는데 이제 다음과 같습니다.

    #deb http://security.debian.org/debian-security stretch/updates main non-free contrib
#deb-src http://security.debian.org/debian-security stretch/updates main non-free contrib

# stretch-updates, previously known as 'volatile'
#deb http://ftp.au.debian.org/debian/ stretch-updates main non-free contrib
#deb-src http://ftp.au.debian.org/debian/ stretch-updates main non-free contrib

#deb http://ftp.debian.org/debian stretch-backports main

#deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 
#deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
#deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
#deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse 
#deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian-security/ buster/updates main
deb http://deb.debian.org/debian buster-updates main

source.list.d를 확인했습니다.

내부에는 많은 저장소가 있습니다.

google-chrome.list
google-chrome.list.save
oibaf-ubuntu-graphics-drivers-eoan.list
oibaf-ubuntu-graphics-drivers-eoan.list.save
qucs-ubuntu-qucs-disco.list
qucs-ubuntu-qucs-disco.list.save
stretch-backports.list
stretch-backports.list.save
ubuntu-x-swat-ubuntu-updates-eoan.list
ubuntu-x-swat-ubuntu-updates-eoan.list.save
webupd8team-ubuntu-brackets-eoan.list
webupd8team-ubuntu-brackets-eoan.list.save

열어서 다 확인했는데 linux-image-generic-lts-xenial이름이 하나도 없었어요. 이름에 우분투를 사용하는 사람들도 범인일 수 있다고 생각합니다. 나는 또한 달리기를 시도했지만 apt purge linux-firmware이전과 같은 오류가 발생했습니다.

관련 정보