I just followed the Atlas CLI installation instructions on MongoDB's website here down to this part:
- Create the list file
/etc/apt/sources.list.d/mongodb-org-6.0.list
for your version of Ubuntu. Replace6.0
with your edition of MongoDB. echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
There is a resulting file at/etc/apt/sources.list.d/
, and inside, it only has:
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/6.0 multiverse
But when I run sudo apt-get update
, it says:
E: Malformed entry 1 in list file /etc/apt/sources.list.d/mongodb-org-6.0.list (Component)
E: The list of sources could not be read.
I technically have version 6.3, but there is nothing there if I go to that URL in my browser. Nevertheless, I've separately tried:
- changing the filename and contents to 6.3 instead of 6.0
- removing the
[ arch=amd64,arm64 ]
ormultiverse
bit just to narrow down the issue - recopying and pasting the part in quotes directly into the file from the website
- deleting-recreating the file
- updating to the latest Ubuntu version?!
The error doesn't change with any of this. When I copy-paste the LIST file URL into my browser, it goes to the right place, so it has to be correct.
I do not know if this is connected to WSL, which causes all sorts of mysterious issues. Please help!
1条答案
按热度按时间pdkcd3nj1#
我也遇到了同样的问题。查看我的Ubuntu版本(与您的版本不同,我的版本是v20.04)的/etc/apt/sources.list.d/mongodb-org-6.0.list文件的内容,显示如下:
然而,这似乎缺少了一个参数。我之前安装了MongoDB v5. 0,当时的内容如下:
通过比较这两个版本,我决定手动更改6.0安装的代码行,使其格式与5.0相同:
这对我的Ubuntu 20.04安装很有效。我相信你在安装仿生海狸(18.04)(在我看来,这是有史以来最好的操作系统动物名称)时也面临着同样的情况。
在您的情况下,您具有以下内容:
我相信--尽管我可能错了--它应该是这样的:
或者,运行我认为应该在MongoDB站点上运行的Bionic Beaver的完整命令可能会更容易:
接下来,尝试另一个“sudo apt更新”。我希望那能起作用!