0

I'm trying to install nodejs, however I get the follow error message:

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: nodejs : Depends: python-minimal but it is not installable E: Unable to correct problems, you have held broken packages.

Then when trying to install python-minimal it fails, and says python2-minimal replaces. Python2-minimal is already the newest version

sudo apt-get -f install

Returns with

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

The command:

dpkg --get-selections | grep hold

Does not list any output.

Any suggestions?

sudo apt update output

Hit:1 http://azure.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:5 https://deb.nodesource.com/node_14.x bionic InRelease
Fetched 101 kB in 0s (254 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

sudo apt upgrade output

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Full sudo apt-get install nodejs output

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: nodejs : Depends: python-minimal but it is not installable E: Unable to correct problems, you have held broken packages.

NPC
  • 1

1 Answers1

0

This is old, but I just ran into this upgrading an old server. There is a nodejs source that needs to be updated at /etc/apt/sources.list.d/nodesource.list. Change the node version number and the release name. For example, mine had https://deb.nodesource.com/node_10.x bionic InRelease so I updated it to https://deb.nodesource.com/node_18.x focal InRelease. Then run apt update and apt install nodejs.

andyrue
  • 101
  • 1