![Ubuntu apt가 작동하지 않습니다](https://linux55.com/image/186278/Ubuntu%20apt%EA%B0%80%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4.png)
Ubuntu Linux(버전 20.04.1 LTS)에서 apt를 사용하여 무언가를 설치하려고 할 때마다 항상 다음 오류 메시지가 나타납니다.
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
다음을 실행하려고 하면 sudo apt --fix-broken install
다음 오류가 발생합니다 .
buntu@ubuntu1:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
gir1.2-mutter-6 gnome-startup-applications humanity-icon-theme
libasn1-8-heimdal libgssapi3-heimdal libgstreamer-plugins-good1.0-0
libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal
libhx509-5-heimdal libkrb5-26-heimdal libmozjs-68-0 libroken18-heimdal
libwind0-heimdal session-migration ubuntu-mono
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libgstreamer-plugins-bad1.0-0
The following packages will be upgraded:
libgstreamer-plugins-bad1.0-0
1 to upgrade, 0 to newly install, 0 to remove and 1078 not to upgrade.
192 not fully installed or removed.
Need to get 2,278 kB of archives.
After this operation, 2,230 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://kali.download/kali kali-rolling/main amd64 libgstreamer-plugins-bad1.0-0 amd64 1.18.0-2+b1 [2,278 kB]
Fetched 2,278 kB in 1s (2,652 kB/s)
(Reading database ... 225910 files and directories currently installed.)
Preparing to unpack .../libgstreamer-plugins-bad1.0-0_1.18.0-2+b1_amd64.deb ...
Unpacking libgstreamer-plugins-bad1.0-0:amd64 (1.18.0-2+b1) over (1.16.2-2.1ubun
tu1) ...
dpkg: error processing archive /var/cache/apt/archives/libgstreamer-plugins-bad1
.0-0_1.18.0-2+b1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libgstbasecamerabinsrc-1.0.so.0'
, which is also in package libgstreamer-plugins-good1.0-0:amd64 1.16.2-1ubuntu2
Errors were encountered while processing:
/var/cache/apt/archives/libgstreamer-plugins-bad1.0-0_1.18.0-2+b1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
ubuntu@ubuntu1:~$
문제는 이 오류가 온라인에 잘 문서화되어 있는 것 같고 해결책이 많이 있지만 그 중 아무것도 작동하지 않는 것 같습니다. 지난 3시간 동안 많은 것을 시도했지만 아무것도 작동하지 않았기 때문에 결정했습니다. 여기에서 물어보세요.
sudo apt-get update
흥미롭게도 이 매우 긴 메시지를 실행하여 얻으려고 하면 다음과 같은 결과가 출력됩니다.
ubuntu@ubuntu1:~$ sudo apt-get update
Hit:1 http://gb.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:5 http://kali.download/kali kali-rolling InRelease
Fetched 214 kB in 1s (263 kB/s)
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target DEP-11-icons-hidpi (main/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:59 and /etc/apt/sources.list:61
이것은 스택 교환 질문을 하기에는 너무 크기 때문에 콘솔이 제공하는 출력의 작은 부분일 뿐입니다.
답변1
가장 먼저 해야 할 일은 당신의 것을 깨뜨리고 실행하기 때문에 kali-rolling
당신의 것에서 그것을 제거하는 것 입니다:sources.list
apt
sudo apt update
그런 다음 --force-overwrite
옵션을 사용하여 패키지를 강제로 설치합니다.
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libgstreamer-plugins-bad1.0-0_1.18.0-2+b1_amd64.deb
다음은:
sudo apt install -f
sudo apt update
sudo apt upgrade