
패키지가 손상되어 시스템을 업그레이드할 수 없습니다. 나는 몇 달 동안 이 문제를 해결할 수 없었고 솔직히 우분투를 완전히 다시 설치하려고 합니다. 이 게시물은 해결책을 찾는 마지막 희망을 나타냅니다. 내가 시도한 것은 다음과 같습니다.
버전 정보
$ uname -a && gcc --version
Linux prometheus 3.13.0-87-generic #132-Ubuntu SMP Mon May 16 20:51:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
...
소스 목록
$ grep -v "^#" /etc/apt/sources.list /ect/apt/sources.list.d/*
deb http://za.archive.ubuntu.com/ubuntu/ trusty main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-security main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-security main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-backports main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-backports main universe multiverse #Added by software-properties
deb http://archive.canonical.com/ trusty partner
deb-src http://archive.canonical.com/ trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner
적절한 물건을 얻으십시오
$ sudo apt-get update
...
거기에는 문제가 없습니다 ...
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
gcc-4.9-base libgcc1
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
그래서 결국 여러 버전의 gcc를 갖게 된 것 같습니다! 패키지 관리자가 유지 관리하는 버전은 최신 버전입니다.
버전 테이블을 확인하면 알 수 있습니다.
$ apt-cache policy gcc-4.9-base libgcc1
gcc-4.9-base:
Installed: 4.9.2-0ubuntu1~12.04
Candidate: 4.9.3-0ubuntu4
Version table:
4.9.3-0ubuntu4 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
*** 4.9.2-0ubuntu1~12.04 0
100 /var/lib/dpkg/status
4.9-20140406-0ubuntu1 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
libgcc1:
Installed: 1:4.9.2-0ubuntu1~12.04
Candidate: 1:4.9.3-0ubuntu4
Version table:
1:4.9.3-0ubuntu4 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
*** 1:4.9.2-0ubuntu1~12.04 0
100 /var/lib/dpkg/status
1:4.9-20140406-0ubuntu1 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
여전히 정밀한 상태에서 gcc 4.9를 설치할 때 너무 열심이었던 것처럼 보였고 이제는 이상하고 혼란스러운 상태에 이르렀습니다. 돌이켜보면 그것은 나쁜 생각이었을 수도 있다. 시냅틱을 통해 gcc를 업그레이드하려고 시도했지만 필연적으로 엄청나게 긴 패키지 목록(apt 포함)을 제거하려고 하는데 이는 매우 바람직하지 않은 것 같습니다.
그래서 내 질문은: 시스템을 복구하고 종속성 문제를 해결할 수 있는 희망이 있습니까??
업데이트
$ sudo apt-get install --reinstall gcc-4.9-base libgcc1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gvfs : Depends: gvfs-daemons (>= 1.20.3-0ubuntu1.2)
Depends: gvfs-daemons (< 1.20.3-0ubuntu1.2.1~)
indicator-network : Depends: unity8 (>= 7.82) but it is not going to be installed
libegl1-mesa : Depends: libgbm1 (>= 7.11~1) but it is not going to be installed
Recommends: libegl1-mesa-drivers
libgl1-mesa-glx : Depends: libglapi-mesa (= 10.1.3-0ubuntu0.6)
Recommends: libgl1-mesa-dri (>= 7.2)
libqt5gui5 : Depends: libgbm1 (>= 8.1~0) but it is not going to be installed
libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-0ubuntu1~12.04) but 4.9.3-0ubuntu4 is to be installed
libubuntu-application-api-mirserver1 : Depends: libmirserver18 (>= 0.1.8+14.04.20140408.1) but it is not going to be installed
libunity-mir1 : Depends: libmirserver18 (>= 0.1.8+14.04.20140411) but it is not going to be installed
unity-scope-mediascanner2 : Depends: mediascanner2.0 but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
나는 또한 이 수정을 시도했지만 소용이 없었습니다.
sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Starting pkgProblemResolver with broken count: 7
Starting 2 pkgProblemResolver with broken count: 7
Investigating (0) libstdc++6 [ amd64 ] < 4.9.2-0ubuntu1~12.04 > ( libs )
Broken libstdc++6:amd64 Depends on gcc-4.9-base [ amd64 ] < 4.9.2-0ubuntu1~12.04 -> 4.9.3-0ubuntu4 > ( libs ) (= 4.9.2-0ubuntu1~12.04)
Considering gcc-4.9-base:amd64 17 as a solution to libstdc++6:amd64 525
Added gcc-4.9-base:amd64 to the remove list
Fixing libstdc++6:amd64 via keep of gcc-4.9-base:amd64
Investigating (0) libgcc1 [ amd64 ] < 1:4.9.2-0ubuntu1~12.04 -> 1:4.9.3-0ubuntu4 > ( libs )
Broken libgcc1:amd64 Depends on gcc-4.9-base [ amd64 ] < 4.9.2-0ubuntu1~12.04 -> 4.9.3-0ubuntu4 > ( libs ) (= 4.9.3-0ubuntu4)
Considering gcc-4.9-base:amd64 17 as a solution to libgcc1:amd64 463
Holding Back libgcc1:amd64 rather than change gcc-4.9-base:amd64
Try to Re-Instate (0) gcc-4.9-base:amd64
Try to Re-Instate (1) libgcc1:amd64
Done
Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages have been kept back:
gcc-4.9-base libgcc1
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
강제 재설치를 시도하기 전에 gcc-4.8로 롤백한 다음 업그레이드를 다시 시도할 수도 있습니다...
답변1
좋아, 명령 목록이 이 문제를 해결할 가능성이 높습니다. 게시된 옵션이 점점 더 공격적으로 변하고 있으므로 솔루션 시도 #1부터 시작하는 것이 가장 좋습니다.
1. 패키지 소프트 재설치 수행:
sudo apt-get install --reinstall gcc-4.9-base libgcc1
2. 손상된 패키지를 강제 설치합니다.
sudo apt-get -f install
3. 다음을 통해 제거 dpkg
하고 다시 설치 apt-get
:
sudo dpkg -r --force gcc-4.9-base
sudo dpkg -r --force libgcc1
sudo apt-get install gcc-4.9-base libgcc1
메모: 이렇게 하면 시스템이 손상될 수 있으며 그럴 수도 있습니다(예 apt
: ).~ 아니다두 패키지를 모두 다운로드하여 다시 설치할 때까지 재부팅하고 필요한 경우 해당 패키지의 종속성을packages.ubuntu.com. dpkg -i <packacge-name>
이 옵션은 최후의 수단으로만 사용하십시오.