Sunday 29 April 2018

The following packages have unmet dependencies: nodejs : Conflicts: nodejs-legacy

while setting up an iquidus explorer i just hacked my way to nodejs-legacy installing freedom through sheer elan ... maybe


after being given access to someone elses pre-loved server,
was getting error whilst trying to install nodejs-legacy
The following packages have unmet dependencies:
 nodejs : Conflicts: nodejs-legacy

not entirely which bit was the real magic but after an extended duration of getting constant rejections this is hopefully the bare basics,
possibly it's more than everything necessary.
remove nodejs, install nodejs from nodesource, change package manager priority to ubuntu servers, upgrade nodejs, install nodejs-legacy


remove current nodejs
# apt-get remove nodejs

update etc
# apt install -f
# apt update
# apt dist-upgrade

install nodejs v10 from the horses mouth (ie nodesource itself)
# curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
# apt-get install nodejs -y

..
etc
..

# nodejs -v
v10.0.0

adjust priority to ubuntu servers and upgrade to v10.25
# apt-cache policy nodejs
nodejs:
  Installed: 10.0.0-1nodesource1
  Candidate: 10.0.0-1nodesource1
  Version table:
 *** 10.0.0-1nodesource1 0
        500 https://deb.nodesource.com/node_10.x/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0

        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
nano /etc/apt/preferences.d/nodejs

.. in my case i gave archive.ubuntu.com a higher value by adding the following
Package: *
Pin: origin archive.ubuntu.com
Pin-Priority: 1002
..

# apt-cache policy nodejs
nodejs:
  Installed: 10.0.0-1nodesource1
  Candidate: 0.10.25~dfsg2-2ubuntu1
  Version table:
 *** 10.0.0-1nodesource1 0
        500 https://deb.nodesource.com/node_10.x/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0
       1002 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

re-install and success !!
# apt-get install --reinstall nodejs 

.. updates nodejs ..

# apt-get install nodejs-legacy





discussion on raising the package priority
https://github.com/nodejs/help/issues/1040#issuecomment-362970187

No comments:

Post a Comment