I was trying to uninstall and reinstall Cassandra on my Ubuntu system however in an attempt to cleanup I deleted file names with cassandra in it, and accidentally deleted requisite file including the /etc/apt/sources.list.d/cassandra.sources.list file. And now when I try to install Cassandra using the command sudo apt-get install cassandra
, it gives the error E: Package 'cassandra' has no installation candidate
. How can I fix this?
I ran sudo apt-get update
and the cassandra.sources.list file seems to have come back, with content deb [arch=amd64] https://downloads.apache.org/cassandra/debian 311x main
but it still gives same error on trying to install cassandra
3
Answers
I was able to follow the documentation to install cassandra, the only thing that I adjusted was the
curl -L flag
but apart from that this can solve your problem.This error indicates that APT was not able to find a source for the package:
The cause for the error is that you added the wrong repository in your sources:
If you have a look at the Cassandra installation document I wrote on the Apache website, the correct repository is
www.apache.org/dist/cassandra/debian
.If you want to install Cassandra 3.11, You need to delete your source and update it with:
You’ll need to follow the document above to add the repo keys and update the package index on your server. Then to install C* 3.11.11 (for example), run:
You’ll need to adapt the command above to the specific version you want to install. Otherwise, APT will attempt to install the latest version. Cheers!
The comment above solved my problem ^
deb [arch=amd64] https://downloads.apache.org/cassandra/debian 311x main