VirtualBox 6.1.x 설치를 위해 취소된 VirtualBox 7.0.x를 제거하는 방법은 무엇입니까?

VirtualBox 6.1.x 설치를 위해 취소된 VirtualBox 7.0.x를 제거하는 방법은 무엇입니까?

Ubuntu Desktop 22.04가 실행되었습니다.

sudo dpkg -i virtualbox-7.0_7.0.4-154605~Ubuntu~jammy_amd64.deb 

그러나 unpacking 과정을 통해 ctrl+를 통해 취소되었습니다 c. 대신 6.1.40 버전이 필요하기 때문입니다. 몇 초 후에 실행되었습니다.

sudo dpkg -i virtualbox-6.1_6.1.40-154048~Ubuntu~jammy_amd64.deb 

그리고 쇼

(Reading database ... 200469 files and directories currently installed.)
Preparing to unpack virtualbox-6.1_6.1.40-154048~Ubuntu~jammy_amd64.deb ...
Unpacking virtualbox-6.1 (6.1.40-154048~Ubuntu~jammy) over (6.1.40-154048~Ubuntu~jammy) ...
dpkg: dependency problems prevent configuration of virtualbox-6.1:
 virtualbox-6.1 depends on libqt5core5a (>= 5.15.1); however:
  Package libqt5core5a is not installed.
 virtualbox-6.1 depends on libqt5gui5 (>= 5.14.1) | libqt5gui5-gles (>= 5.14.1); however:
  Package libqt5gui5 is not installed.
  Package libqt5gui5-gles is not installed.
 virtualbox-6.1 depends on libqt5opengl5 (>= 5.0.2); however:
  Package libqt5opengl5 is not installed.
 virtualbox-6.1 depends on libqt5printsupport5 (>= 5.0.2); however:
  Package libqt5printsupport5 is not installed.
 virtualbox-6.1 depends on libqt5widgets5 (>= 5.15.1); however:
  Package libqt5widgets5 is not installed.
 virtualbox-6.1 depends on libqt5x11extras5 (>= 5.6.0); however:
  Package libqt5x11extras5 is not installed.
 virtualbox-6.1 depends on libsdl1.2debian (>= 1.2.11); however:
  Package libsdl1.2debian is not installed.

dpkg: error processing package virtualbox-6.1 (--install):
 dependency problems - leaving unconfigured
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:
 virtualbox-6.1

따라서 실행되었으며 sudo apt -f install다음을 보여줍니다.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: The package virtualbox-7.0 needs to be reinstalled, but I can't find an archive for it.

sudo apt purge virtualbox-7.0쇼 포함

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: The package virtualbox-7.0 needs to be reinstalled, but I can't find an archive for it.

나중에 제거하기 위해 VB 7을 다시 설치하려고 하면

sudo apt install ./virtualbox-7.0_7.0.4-154605~Ubuntu~jammy_amd64.deb 

이것은 보여준다

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 virtualbox-6.1 : Depends: libqt5core5a (>= 5.15.1) but it is not installed
                  Depends: libqt5gui5 (>= 5.14.1) but it is not installed or
                           libqt5gui5-gles (>= 5.14.1) but it is not installed
                  Depends: libqt5opengl5 (>= 5.0.2) but it is not installed
                  Depends: libqt5printsupport5 (>= 5.0.2) but it is not installed
                  Depends: libqt5widgets5 (>= 5.15.1) but it is not installed
                  Depends: libqt5x11extras5 (>= 5.6.0) but it is not installed
                  Depends: libsdl1.2debian (>= 1.2.11)
                  Recommends: libsdl-ttf2.0-0 but it is not installed
                  Recommends: gcc but it is not installed
                  Recommends: make or
                              build-essential but it is not installed or
                              dpkg-dev but it is not installed
                  Recommends: binutils but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

실행되면 apt --fix-broken install표시됩니다.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: The package virtualbox-7.0 needs to be reinstalled, but I can't find an archive for it.

VB 6.1을 다시 설치하려면

sudo apt install ./virtualbox-6.1_6.1.40-154048~Ubuntu~jammy_amd64.deb 

보여줍니다(7을 참조하세요).

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: The package virtualbox-7.0 needs to be reinstalled, but I can't find an archive for it.

VB 6.1을 제거하려면 sudo apt purge virtualbox-6.1다음과 같이 표시됩니다.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: The package virtualbox-7.0 needs to be reinstalled, but I can't find an archive for it.

이 문제를 해결하는 방법은 무엇입니까?

목표는 VB 7을 완전히 제거하고 VB 6.1을 평화롭게 설치하는 것입니다.

알파

user535733의 제안에 따르면 다음 명령이 실행됩니다.

sudo dpkg -i virtualbox-7.0_7.0.4-154605~Ubuntu~jammy_amd64.deb 

나타납니다

dpkg: regarding virtualbox-7.0_7.0.4-154605~Ubuntu~jammy_amd64.deb containing virtualbox-7.0:
 virtualbox-7.0 conflicts with virtualbox
  virtualbox-6.1 provides virtualbox and is present and unpacked but not configured.

dpkg: error processing archive virtualbox-7.0_7.0.4-154605~Ubuntu~jammy_amd64.deb (--install):
 conflicting packages - not installing virtualbox-7.0
Errors were encountered while processing:
 virtualbox-7.0_7.0.4-154605~Ubuntu~jammy_amd64.deb

답변1

다음 명령을 사용하여 가능한 해결책을 찾았습니다.

sudo dpkg --remove --force-remove-reinstreq <packagename>

게시물 및 솔루션에 따라:

그러나 첫 번째 의견은 다음과 같습니다.

This command should always be avoided as it breaks you system more than it repairs

그것이 사실인지 아닌지 확실하지 않습니다.하지만 위험하다

해결책

따라서 나는 다음을 수행했고 마침내 작동했습니다.

sudo cp /var/lib/dpkg/status status.bkp
sudo gedit /var/lib/dpkg/status

오류 메시지가 포함된 섹션을 제거합니다. 내 경우에는 다음과 같았습니다.

Package: virtualbox-7.0
Status: install reinstreq half-installed
Priority: optional
Section: contrib/misc
Architecture: amd64
Version: 7.0.4-154605~Ubuntu~jammy

관찰하다 status-reinstreq 설치 절반 설치

이 솔루션의 소스/크레딧은 이 게시물에 있습니다.

따라서 명령이 제대로 작동합니다.

sudo dpkg -i virtualbox-6.1_6.1.40-154048~Ubuntu~jammy_amd64.deb
sudo apt -f install

그리고 VirtualBox에 대해서7다음 명령을 사용하면 다음과 같은 일이 발생합니다.

sudo apt remove virtualbox-7
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package virtualbox-7

sudo apt remove virtualbox-7.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'virtualbox-7.0' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

sudo apt purge virtualbox-7.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'virtualbox-7.0' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

그래서 모든 것이 괜찮은 것 같습니다.

관련 정보