操作系统:Linux Mint 18.3。类似于 Ubuntu。
与 Linux 一样,我真的不知道我打算如何安装软件:
- 它已经在系统上了吗?在这种情况下是的,但它很旧:4.2.6。在撰写本文时,当前的 LTS 版本是 10.16.3。
- 我应该使用apt吗?
- 我应该使用软件管理器吗?
- 我应该使用 PPA 吗?
- 我应该下载压缩文件并解压缩吗?
来自其他用户的软件管理器评论类似于“去这里获取最新版本”(https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions)
第一个命令是
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
这失败了:
>
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
...我不确定所有这些 mariadb 命令的全部内容。我的系统上有 MariaDB,我担心有什么问题。
NB 尝试下一个命令似乎表明这已经失败:
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.
... 即系统仍然认为 4.2.6 是最新版本。
更一般地说,在 Linux 中安装新软件的协议究竟是什么:上面的编号列表(从 1 到 5)是正确的方法吗?专家安装新软件的方法的优先顺序是什么?
然后我尝试了什么
似乎失败sudo apt-get update
是问题的根源。
受其他问题的启发,我尝试了这个:
sudo rm /var/lib/apt/lists/* -vf
其次是:
sudo apt-get update
更多对我来说意义不大的错误和警告列表:
...
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.
后来我在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.
当您
node.js
使用安装时,sudo apt install nodejs
您将获得一个版本,该版本经过测试在您的 Linux 发行版中是稳定的。这也意味着您会得到一个非常过时的软件版本,并且某些软件包会拒绝使用它。比如当前版本的Rocket.Chat
requiresnode.js >= 12
,而我Ubuntu 20.04
的官方版本是 10.x 之类的。在您编写问题时,它可能很新,这就是您使用命令的原因它执行一个脚本,安装版本
node.js-10.x
。据我所知,脚本抱怨的问题是它无法找到它正在使用的某些存储库的公钥。密钥的问题通常是由于
root
用户的一些奇怪设置,密钥文件的权限被证明是错误的。解决方案是检查目录中的权限
他们应该看起来像这样(
-rw-r--r--
是许可644
)如果某些文件的输出不同,请手动更改
我做到了。最后我发现我不得不调整一个安装脚本。
具体来说这是从这里来的。但是,我没有执行 CURL 命令,而是从该 URL 下载了脚本,并用“apt-get update”注释掉了这两行……然后命名该文件并使其可执行并运行它。
然后我去了
然后我去了
原因
apt-get update
是当前在我的系统上返回错误,并且似乎在脚本在源列表中设置 PPA 之前杀死了脚本(这是正确的术语吗?)。我可能错了。我是一个低级的 Linux 人。注意一个脚本似乎是必要的,尤其是我注意到有一个部分文件“翻译”了从我的系统中找到的“Linux Mint”-“sylvia”到“Ubuntu”-“xenial”。实际上,在下载站点,URL“.../Linux Mint/sylvia/...”是不存在的,并返回 404。