AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 541939
Accepted
mike rodent
mike rodent
Asked: 2019-09-16 16:28:19 +0800 CST2019-09-16 16:28:19 +0800 CST 2019-09-16 16:28:19 +0800 CST

O que há de errado com minha tentativa de instalar/atualizar o Node.JS no Linux?

  • 772

SO: Linux Mint 18.3. Semelhante ao Ubuntu.

Como sempre com o Linux, eu realmente não sei como devo proceder para instalar o software:

  1. já está no sistema? Neste caso sim, mas é muito antigo: 4.2.6. A versão LTS atual no momento da escrita é 10.16.3.
  2. devo usar o apt?
  3. devo usar o Gerenciador de Software?
  4. devo usar um PPA?
  5. devo baixar um arquivo compactado e extrair?

Os comentários do Gerenciador de software de outros usuários são coisas como "vá aqui para a versão mais recente" ( https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions )

O primeiro comando que existe

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

Isso falha:

> 
mike@M17A ~ $  curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
[sudo] password for mike: 

## Installing the NodeSource Node.js 10.x repo...


## Populating apt-get cache...

+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease                        
Hit:3 http://dl.google.com/linux/chrome/deb stable Release                     
Hit:4 http://ppa.launchpad.net/adabbas/1stppa/ubuntu xenial InRelease          
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]       
Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]     

... // then many messages like this:

Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:43 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:44 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:44 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Fetched 329 kB in 23s (14.0 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Failed to fetch http://repository.spotify.com/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
W: Some index files failed to download. They have been ignored, or old ones used instead.
Error executing command, exiting

... Eu não tenho certeza do que todos esses comandos mariadb são. Eu tenho o MariaDB no meu sistema e estou preocupado que algo ali esteja com o problema.

NB tentar o próximo comando parece indicar que isso falhou:

mike@M17A ~ $  sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.2).
0 to upgrade, 0 to newly install, 0 to remove and 600 not to upgrade.

... ou seja, o sistema ainda acredita que 4.2.6 é a versão mais recente.

De maneira mais geral, qual é exatamente o protocolo para instalar um novo software no Linux: a lista numerada acima, de 1 a 5, é a metodologia correta? Usando que ordem de prioridade para o método os especialistas instalam o novo software?

O que eu tentei então

Parecia que a falha sudo apt-get updateestava na raiz do problema.

Inspirado por outras perguntas, tentei isso:

sudo rm /var/lib/apt/lists/* -vf

seguido disso:

sudo apt-get update

Mais listas de erros e avisos que não significam muito para mim:

...
Err:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages
  404  Not Found
Ign:41 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:43 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:44 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Fetched 329 kB in 28s (11.6 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Failed to fetch http://repository.spotify.com/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
W: Some index files failed to download. They have been ignored, or old ones used instead.

Mais tarde tentei a "instalação manual" na página do github ...

mike@M17A ~ $  VERSION=node_10.16.3
mike@M17A ~ $  DISTRO="$(lsb_release -s -c)"
mike@M17A ~ $  echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
deb https://deb.nodesource.com/node_10.16.3 sylvia main
mike@M17A ~ $  echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
deb-src https://deb.nodesource.com/node_10.16.3 sylvia main
mike@M17A ~ $  sudo apt-get update
Hit:1 http://ppa.launchpad.net/adabbas/1stppa/ubuntu xenial InRelease
...

Ign:57 https://deb.opera.com/opera-stable stable/non-free Translation-en
Err:58 https://deb.opera.com/opera-stable stable/non-free amd64 Packages
  503  Backend unavailable, connection timeout
Ign:59 https://deb.opera.com/opera-stable stable/non-free i386 Packages
Fetched 3,316 B in 34s (95 B/s)
Reading package lists... Done
W: The repository 'https://deb.nodesource.com/node_10.x sylvia Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
W: The repository 'http://repository.spotify.com stable InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://deb.opera.com/opera-stable stable Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://deb.nodesource.com/node_10.x/dists/sylvia/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://deb.opera.com/opera-stable/dists/stable/non-free/binary-amd64/Packages  503  Backend unavailable, connection timeout
E: Some index files failed to download. They have been ignored, or old ones used instead.
linux-mint
  • 2 2 respostas
  • 7935 Views

2 respostas

  • Voted
  1. John Smith
    2021-08-25T14:21:18+08:002021-08-25T14:21:18+08:00

    Quando você está instalando node.jsusando sudo apt install nodejs, está obtendo uma versão, que é testada para ser estável em sua distribuição Linux. Isso também significa que você obtém uma versão bastante desatualizada do software e que alguns pacotes simplesmente se recusam a trabalhar com ela. Por exemplo, a versão atual do Rocket.Chatrequire node.js >= 12, e no meu Ubuntu 20.04a versão oficial é algo como 10.x. No momento em que você estava escrevendo sua pergunta, provavelmente era muito novo e é por isso que você estava usando um comando

    curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
    

    que executa um script, que instala a versão node.js-10.x.

    Até onde posso ver, o problema que o script reclama é que ele não consegue encontrar chaves públicas para alguns dos repositórios que está usando. Muitas vezes, o problema com as chaves é que, devido a algumas configurações estranhas para rooto usuário, as permissões para arquivos de chave acabam sendo erradas.

    A solução é verificar as permissões nos diretórios

    $ ls -l /etc/apt/sources.list.d/
    $ ls -l /usr/share/keyrings/
    

    Eles devem ficar assim ( -rw-r--r--é permissão 644)

    -rw-r--r-- 1 root root  2206 Aug 25 00:40 nodesource.gpg
    

    Se a saída de alguns arquivos for diferente, altere-a manualmente

    sudo chmod 644 /usr/share/keyrings/nodesource.gpg
    
    • 3
  2. Best Answer
    mike rodent
    2019-09-17T15:43:28+08:002019-09-17T15:43:28+08:00

    Eu consegui. No final, descobri que tinha que ajustar um script de instalação.

    Especificamente, isso veio daqui . No entanto, em vez de executar o comando CURL, baixei o script dessa URL e comentei as duas linhas com "apt-get update" ...

    Então eu fui

    sudo apt-get update
    

    e então eu fui

    sudo apt-get install nodejs
    

    O motivo foi que apt-get updateestá retornando com erros no meu sistema, e parece que isso matou o script antes de configurar o PPA na lista de fontes (este é o termo certo?). Eu posso estar errado sobre isso. Eu sou uma pessoa Linux de baixo nível.

    NB um script parece ser necessário, pelo menos notei que havia uma seção onde o arquivo "traduziu" o "Linux Mint"-"sylvia" encontrado do meu sistema para "Ubuntu"-"xenial". De fato, no site de download, a URL ".../Linux Mint/sylvia/..." é inexistente e retorna um 404.

    • 0

relate perguntas

  • Atualizar libinput no Linux Mint

  • linux java -version funciona apenas para usuário root [fechado]

  • Qual é o procedimento correto para substituir o MDM pelo LightDM no Linux Mint?

  • Danos no kernel do Linux Mint

  • Configurações de Arquivo do Gerenciador de Pacotes Synaptic

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Possível firmware ausente /lib/firmware/i915/* para o módulo i915

    • 3 respostas
  • Marko Smith

    Falha ao buscar o repositório de backports jessie

    • 4 respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    user12345 Falha ao buscar o repositório de backports jessie 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl Por que a maioria dos exemplos do systemd contém WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST

Hot tag

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve