Como determinar qual pacote instalar?

0

No Mac, como usei node para executar o NodeJS, presumo que faria o mesmo no Ubuntu (como gcc para o compilador C GNU).

Então eu digitei node e ele diz

The program 'node' can be found in the following packages:
 * node
 * nodejs-legacy
Try: sudo apt-get install <selected package>

Então parecia que seria node .

Mas, se eu usar apt-cache search ^node$ para pesquisar sua descrição, isso não mostrará nada. Se eu usar apt-cache search ^nodejs$ , ele mostrará nodejs - evented I/O for V8 javascript .

E assim parecia que seria nodejs .

(Além disso, apt-cache show node não exibiu nada, enquanto apt-cache show nodejs mostrou muitas informações, então parecia haver uma chance maior de ser nodejs . No entanto, e quando eu digitei% co_de? %, ele disse "O programa 'node' pode ser encontrado nos seguintes pacotes: node, nodejs-legacy"?)

Nesta situação, como você pode dizer qual é a correta? Estou menos interessado em saber qual é o correto, mas estou mais interessado em aprender como descobrir a partir da informação dada até agora.

Atualização:

como por solicitação @ muru, esta é a saída de

$ sudo apt-get update

Hit http://us.archive.ubuntu.com wily InRelease
Hit http://us.archive.ubuntu.com wily-updates InRelease               
Hit http://security.ubuntu.com wily-security InRelease                 
Hit http://us.archive.ubuntu.com wily-backports InRelease
Hit http://us.archive.ubuntu.com wily/main Sources                     
Hit http://security.ubuntu.com wily-security/main Sources   
Hit http://us.archive.ubuntu.com wily/restricted Sources    
Hit http://security.ubuntu.com wily-security/restricted Sources  
Hit http://us.archive.ubuntu.com wily/universe Sources        
Hit http://us.archive.ubuntu.com wily/multiverse Sources      
Hit http://security.ubuntu.com wily-security/universe Sources 
Hit http://us.archive.ubuntu.com wily/main amd64 Packages         
Hit http://us.archive.ubuntu.com wily/restricted amd64 Packages   
Hit http://security.ubuntu.com wily-security/multiverse Sources   
Hit http://us.archive.ubuntu.com wily/universe amd64 Packages     
Hit http://security.ubuntu.com wily-security/main amd64 Packages  
Hit http://us.archive.ubuntu.com wily/multiverse amd64 Packages   
Hit http://us.archive.ubuntu.com wily/main i386 Packages          
Hit http://security.ubuntu.com wily-security/restricted amd64 Packages
Hit http://us.archive.ubuntu.com wily/restricted i386 Packages      
Hit http://us.archive.ubuntu.com wily/universe i386 Packages        
Hit http://security.ubuntu.com wily-security/universe amd64 Packages
Hit http://us.archive.ubuntu.com wily/multiverse i386 Packages 
Hit http://us.archive.ubuntu.com wily/main Translation-en      
Hit http://security.ubuntu.com wily-security/multiverse amd64 Packages
Hit http://us.archive.ubuntu.com wily/multiverse Translation-en    
Hit http://security.ubuntu.com wily-security/main i386 Packages    
Hit http://us.archive.ubuntu.com wily/restricted Translation-en    
Hit http://security.ubuntu.com wily-security/restricted i386 Packages
Hit http://us.archive.ubuntu.com wily/universe Translation-en      
Hit http://security.ubuntu.com wily-security/universe i386 Packages
Hit http://us.archive.ubuntu.com wily-updates/main Sources         
Hit http://us.archive.ubuntu.com wily-updates/restricted Sources   
Hit http://security.ubuntu.com wily-security/multiverse i386 Packages
Hit http://us.archive.ubuntu.com wily-updates/universe Sources      
Hit http://us.archive.ubuntu.com wily-updates/multiverse Sources    
Hit http://security.ubuntu.com wily-security/main Translation-en
Hit http://us.archive.ubuntu.com wily-updates/main amd64 Packages
Hit http://security.ubuntu.com wily-security/multiverse Translation-en
Hit http://us.archive.ubuntu.com wily-updates/restricted amd64 Packages
Hit http://us.archive.ubuntu.com wily-updates/universe amd64 Packages
Hit http://security.ubuntu.com wily-security/restricted Translation-en
Hit http://us.archive.ubuntu.com wily-updates/multiverse amd64 Packages
Hit http://us.archive.ubuntu.com wily-updates/main i386 Packages   
Hit http://security.ubuntu.com wily-security/universe Translation-en
Hit http://us.archive.ubuntu.com wily-updates/restricted i386 Packages
Hit http://us.archive.ubuntu.com wily-updates/universe i386 Packages
Hit http://us.archive.ubuntu.com wily-updates/multiverse i386 Packages
Hit http://us.archive.ubuntu.com wily-updates/main Translation-en
Hit http://us.archive.ubuntu.com wily-updates/multiverse Translation-en
Hit http://us.archive.ubuntu.com wily-updates/restricted Translation-en
Hit http://us.archive.ubuntu.com wily-updates/universe Translation-en
Hit http://us.archive.ubuntu.com wily-backports/main Sources
Hit http://us.archive.ubuntu.com wily-backports/restricted Sources
Hit http://us.archive.ubuntu.com wily-backports/universe Sources
Hit http://us.archive.ubuntu.com wily-backports/multiverse Sources
Hit http://us.archive.ubuntu.com wily-backports/main amd64 Packages
Hit http://us.archive.ubuntu.com wily-backports/restricted amd64 Packages
Hit http://us.archive.ubuntu.com wily-backports/universe amd64 Packages
Hit http://us.archive.ubuntu.com wily-backports/multiverse amd64 Packages
Hit http://us.archive.ubuntu.com wily-backports/main i386 Packages
Hit http://us.archive.ubuntu.com wily-backports/restricted i386 Packages
Hit http://us.archive.ubuntu.com wily-backports/universe i386 Packages
Hit http://us.archive.ubuntu.com wily-backports/multiverse i386 Packages
Hit http://us.archive.ubuntu.com wily-backports/main Translation-en
Hit http://us.archive.ubuntu.com wily-backports/multiverse Translation-en
Hit http://us.archive.ubuntu.com wily-backports/restricted Translation-en
Hit http://us.archive.ubuntu.com wily-backports/universe Translation-en
Reading package lists... Done

$ apt-cache show node | grep -i Desc
$                           # <-- nothing is showing up as result

$ apt-cache show node
N: Can't select versions from package 'node' as it is purely virtual
N: No packages found
    
por 太極者無極而生 26.12.2015 / 12:20

2 respostas

1

De Oceano Digital :

Para instalar o node no Ubuntu, faça o seguinte:

  1. Atualize seus pacotes atuais:

    sudo apt-get update
    
  2. Para adicionar fonte (para versões mais recentes, também, o nó recomenda fazer o download a partir daqui):

    wget -c https://deb.nodesource.com/setup | sudo bash -
    
  3. Para instalar o node.js :

    sudo apt-get install nodejs
    
  4. Você também pode precisar de build-essential para mais recursos (exigidos pelo npm):

    sudo apt-get install build-essential
    
por Raphael 26.12.2015 / 12:32
0

A exibição de apt-cache show deve mostrar suas descrições:

$ apt-cache show node | grep -i Desc
Description: Amateur Packet Radio Node program (transitional package)
Description-md5: 1278ed271672fd829c99361f93f468da
$ apt-cache show nodejs | grep -i Desc
Description: evented I/O for V8 javascript
Description-md5: e507fb472d7cdaceffc5b285a62d5c1b

Se isso não acontecer, você ainda poderá visitar o Índice de Pacotes . Basta ir para http://packages.ubuntu.com/<package-name> :

Como você pode ver, nas duas páginas, os pacotes têm descrições ao lado de seus nomes.

    
por muru 26.12.2015 / 13:24

Tags