如何解决Ubuntu-22.04上依赖项未满足的问题

如何解决Ubuntu-22.04上依赖项未满足的问题

基本上,当我尝试升级我的 ubuntu 时,我收到此错误:

christian@christian-HP-EliteBook-840-G3:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  gnome-control-center gnome-control-center-data gnome-remote-desktop gnome-settings-daemon gnome-settings-daemon-common gnome-shell
  gnome-shell-common gvfs gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs libayatana-appindicator3-1 libinput-bin libinput10
  libnss-systemd libpam-systemd librygel-renderer-2.6-2 librygel-server-2.6-2 libsemanage-common libsystemd0 libsystemd0:i386 libudev1 libwacom-bin
  libwacom-common mutter node-ajv node-constants-browserify node-debbundle-acorn node-errno node-json5 node-mkdirp node-sha.js node-which node-yargs
  node-yargs-parser ntfs-3g passwd rygel sssd-common sssd-krb5 sssd-krb5-common sssd-proxy systemd systemd-sysv systemd-timesyncd ubuntu-desktop
  ubuntu-desktop-minimal udev usb-creator-common usb-creator-gtk xdg-desktop-portal xdg-desktop-portal-gtk xserver-xorg-input-libinput
  yaru-theme-gnome-shell
0 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.

因此当我运行时,sudo apt-get dist-upgrade我收到以下消息:

christian@christian-HP-EliteBook-840-G3:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Error!
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:
 node-yargs-parser : Breaks: node-yargs (< 16.2.0~) but 15.3.1+repack-2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

我该如何解决这个问题?我正在使用 ubuntu 22.04

编辑:输出apt policy node-yargs-parser

christian@christian-HP-EliteBook-840-G3:~$ sudo apt policy node-yargs-parser
[sudo] password for christian:
node-yargs-parser:
   Installed: 18.1.3+~15.0.0-1
   Candidate: 21.0.0+~20.2.1-3
   Version table:
      21.0.0+~20.2.1-3 500
         500 http://rw.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
         500 http://rw.archive.ubuntu.com/ubuntu jammy/universe i386 Packages  *** 18.1.3+~15.0.0-1 100
         100 /var/lib/dpkg/status christian@christian-HP-EliteBook-840-G3:~$ 

答案1

在这种情况下,重新安装正确版本node-yargs-parser应该可以解决问题。运行:

sudo apt install --reinstall node-yargs-parser

相关内容