当我尝试安装时(在最近从 Ubuntu 23.10 升级到 Ubuntu 24.04)
sudo apt install npm
我明白了
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:
npm : Depends: node-abbrev but it is not going to be installed
Depends: node-agent-base but it is not going to be installed
Depends: node-aproba but it is not going to be installed
Depends: node-archy but it is not going to be installed
Depends: node-base64-js but it is not going to be installed
Depends: node-binary-extensions but it is not going to be installed
Depends: node-cacache (>= 17) but it is not going to be installed
Depends: node-chalk (>= 5.1.2-2~) but it is not going to be installed
Depends: node-chownr but it is not going to be installed
Depends: node-ci-info but it is not going to be installed
Depends: node-cli-table3
Depends: node-colors but it is not going to be installed
Depends: node-columnify but it is not going to be installed
Depends: node-cssesc
Depends: node-debug but it is not going to be installed
Depends: node-depd but it is not going to be installed
Depends: node-diff but it is not going to be installed
Depends: node-emoji-regex
Depends: node-encoding but it is not going to be installed
Depends: node-events but it is not going to be installed
Depends: node-glob but it is not going to be installed
Depends: node-got but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-gyp but it is not going to be installed
Depends: node-hosted-git-info (>= 6) but it is not going to be installed
Depends: node-http-proxy-agent but it is not going to be installed
Depends: node-https-proxy-agent but it is not going to be installed
Depends: node-ieee754 but it is not going to be installed
Depends: node-ini but it is not going to be installed
Depends: node-ip but it is not going to be installed
Depends: node-ip-regex but it is not going to be installed
Depends: node-json-parse-better-errors but it is not going to be installed
Depends: node-jsonparse but it is not going to be installed
Depends: node-lru-cache but it is not going to be installed
Depends: node-minimatch but it is not going to be installed
Depends: node-minipass but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-ms but it is not going to be installed
Depends: node-negotiator but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-normalize-package-data but it is not going to be installed
Depends: node-npm-bundled but it is not going to be installed
Depends: node-npm-normalize-package-bin
Depends: node-npm-package-arg (>= 10) but it is not going to be installed
Depends: node-npmlog but it is not going to be installed
Depends: node-once but it is not going to be installed
Depends: node-p-map but it is not going to be installed
Depends: node-postcss-selector-parser
Depends: node-promise-retry but it is not going to be installed
Depends: node-promzard but it is not going to be installed
Depends: node-read but it is not going to be installed
Depends: node-read-package-json but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ssri but it is not going to be installed
Depends: node-string-width but it is not going to be installed
Depends: node-strip-ansi but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-text-table but it is not going to be installed
Depends: node-validate-npm-package-license but it is not going to be installed
Depends: node-validate-npm-package-name but it is not going to be installed
Depends: node-which but it is not going to be installed
Depends: node-wrappy but it is not going to be installed
Depends: node-write-file-atomic but it is not going to be installed
Depends: node-yallist but it is not going to be installed
Depends: nodejs:any
Recommends: node-tap but it is not going to be installed
wine-devel-amd64 : Depends: libasound2-plugins but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
当我跑步时sudo apt --fix-broken install
我得到
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
mailcap
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libasound2-plugins
The following NEW packages will be installed:
libasound2-plugins
0 upgraded, 1 newly installed, 0 to remove and 106 not upgraded.
177 not fully installed or removed.
Need to get 0 B/74.8 kB of archives.
After this operation, 402 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 533433 files and directories currently installed.)
Preparing to unpack .../libasound2-plugins_1.2.7.1-1ubuntu5_amd64.deb ...
Unpacking libasound2-plugins:amd64 (1.2.7.1-1ubuntu5) ...
dpkg: error processing archive /var/cache/apt/archives/libasound2-plugins_1.2.7.1-1ubuntu5_amd64.deb (--unpack):
trying to overwrite shared '/etc/alsa/conf.d/99-pulseaudio-default.conf.example', which is different from other instances of package libasound2-plugi
ns:amd64
Errors were encountered while processing:
/var/cache/apt/archives/libasound2-plugins_1.2.7.1-1ubuntu5_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
如果我尝试删除 wine(我有开发版本):sudo apt remove winehq-devel
或者sudo apt-get --purge remove wine
我遇到同样的问题:
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:
wine-devel-amd64 : Depends: libasound2-plugins but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).