Ubuntu: How can /etc/apt/sources.list.d object be removed?



Question:

I have added

echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list  

Now I want to remove it and install Cassandra in another way.How to delete it?


Solution:1

Open /etc/apt/sources.list.d/cassandra.sources.list for editing in nano text editor and comment out the line that you want to disable by preceding it with a # character at the beginning of the line.

sudo nano /etc/apt/sources.list.d/cassandra.sources.list    

Change this line:

deb http://www.apache.org/dist/cassandra/debian 311x main    

So that it looks like this:

# deb http://www.apache.org/dist/cassandra/debian 311x main    

Nano editor keyboard shortcuts
Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location.
Use the keyboard combination Ctrl + X to exit nano.

Update the list of available software:

sudo apt update     

How to install Cassandra snap package

Cassandra distributed database is a snap package in all currently supported versions of Ubuntu. The current stable version of the cassandra snap package is 3.7 and the edge version is 3.10-SNAPSHOT. To install cassandra run this command:

sudo snap install cassandra     sudo snap connect cassandra:mount-observe    

You can check on the status of the cassandra service with:

systemctl status snap.cassandra.cassandra.service    

If you were able to successfully start Cassandra, check the status of the cluster:

cassandra.nodetool status  

In the output, UN means it's Up and Normal:

Set a custom configuration:

cat cassandra.yaml | sudo /snap/bin/cassandra.config-set cassandra.yaml   

Commands:

  • cassandra.config-get
  • cassandra.config-set
  • cassandra.env-get
  • cassandra.nodetool


Solution:2

The easiest way is sudo rm /etc/apt/sources.list.d/cassandra.sources.list .. this will remove all entries that's in the casandra.sources.list file, but it should only be the one you added.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »