Ubuntu18.04を実行しています。 node
をインストールしたかった およびnpm
私のマシンで。ノードのaptリポジトリバージョンは8.xですが、バージョン12.x(現在のLTSバージョン)が必要でした。
私はここのガイドに従いました:https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04
ガイドに従って、
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
をダウンロードしました。
次に、
sudo -E ./nodesource_setup.sh
を使用して実行しました。
しかし、私のマシンはsudo apt update
を実行できません 次の(完全な)出力で:
[email protected]:~/scripts$ sudo apt update
Hit:1 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:4 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease
E: Repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' changed its 'Suite' value from 'bionic-updates' to 'bionic-security'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N] N
Fetched 88.7 kB in 8s (10.5 kB/s)
Reading package lists... Done
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease
E: Some index files failed to download. They have been ignored, or old ones used instead.
この回答は、apt update
を使用する必要があることを示唆しています apt-get update
の代わりに 。それでも、私はapt update
を実行しています 。
この回答は、プロンプトに「Y」と答えることを示唆しています。
Dockerコミュニティからのこのgithubの問題は、そうすることが悪い考えであることを明らかにしています。
ただし、この回答は、リポジトリがパッケージソースの名前を変更する場合があることを示唆しています。
だから私の質問は、ここでYと答えても大丈夫ですか?パッケージマネージャーが私に投げかけたエラーを盲目的に受け入れたくありません。
承認された回答:
Y
と答えない場合 apt-get(またはapt)が機能することは決してないという質問に。
セキュリティリポジトリがその「Suite」値を「bionic-security」に設定することは合理的と思われます。 bionic-updates
だった理由 わかりませんが、おそらくエラーでした。
apt-get
について コントラapt
、aptはパッケージシステムへの新しいインターフェースとしてUbuntu 16.04で導入されました–ここでse:https://itsfoss.com/apt-vs-apt-get-difference/