Instalando o npm / nodejson ubuntu

2
sudo apt-get install npm

então eu entendo isso:

The following packages have unmet dependencies:

     npm : Depends: nodejs but it is not going to be installed
           Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
           Depends: node-ansi but it is not going to be installed
           Depends: node-archy but it is not going to be installed

mesmo nodejs difíceis existem no sistema, devo instalar separadamente cada dependência como posso instalá-los em um grupo?

Eu também tentei isso:

sudo apt-get install nodejs-dev

e eu entendo isso:

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-dev : Depends: nodejs (= 0.10.25~dfsg2-2ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

por que diz que o nodejs não existe, se está no sistema já instalado ?, se está quebrado como eu poderia consertar? Eu tentei removê-lo e instalar novamente, mas não ajudou, alguma idéia?

EDITAR

npm:
  Installed: (none)
  Candidate: 1.3.10~dfsg-1
  Version table:
     1.3.10~dfsg-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
nodejs:
  Installed: 4.2.1-2nodesource1~trusty1
  Candidate: 4.2.1-2nodesource1~trusty1
  Version table:
 *** 4.2.1-2nodesource1~trusty1 0
        500 https://deb.nodesource.com/node_4.x/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
node-abbrev:
  Installed: 1.0.4-2
  Candidate: 1.0.4-2
  Version table:
 *** 1.0.4-2 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-ansi:
  Installed: 0.2.1-1
  Candidate: 0.2.1-1
  Version table:
 *** 0.2.1-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-archy:
  Installed: 0.0.2-1
  Candidate: 0.0.2-1
  Version table:
 *** 0.0.2-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
    
por user3112115 21.10.2015 / 09:02

1 resposta

0

Primeiro, tentamos forçar a instalação dos pacotes necessários

sudo apt-get install node-abbrev node-ansi node-archy 
sudo apt-get install --reinstall nodejs

E depois de apt-cache policy npm nodejs node-abbrev node-ansi node-archy você tem isso

npm:
  Installed: (none)
  Candidate: 1.3.10~dfsg-1
  Version table:
     1.3.10~dfsg-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
nodejs:
  Installed: 4.2.1-2nodesource1~trusty1
  Candidate: 4.2.1-2nodesource1~trusty1
  Version table:
 *** 4.2.1-2nodesource1~trusty1 0
        500 https://deb.nodesource.com/node_4.x/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
node-abbrev:
  Installed: 1.0.4-2
  Candidate: 1.0.4-2
  Version table:
 *** 1.0.4-2 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-ansi:
  Installed: 0.2.1-1
  Candidate: 0.2.1-1
  Version table:
 *** 0.2.1-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-archy:
  Installed: 0.0.2-1
  Candidate: 0.0.2-1
  Version table:
 *** 0.0.2-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

E como não recebo mais feedback de você

sudo rm /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs=0.10.25~dfsg2-2ubuntu1
sudo apt-get install -f
sudo apt-get install npm
    
por A.B. 21.10.2015 / 10:40