E: Package 'cassandra' has no installation candidate when installing Cassandra - linux

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

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.
$ echo "deb http://www.apache.org/dist/cassandra/debian 40x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
deb http://www.apache.org/dist/cassandra/debian 40x main
# Make sure the `cassandra.sources.list` file has only this single line.
$ sudo cat /etc/apt/sources.list.d/cassandra.sources.list
deb http://www.apache.org/dist/cassandra/debian 40x main
$ curl -L https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 227 100 227 0 0 4283 0 --:--:-- --:--:-- --:--:-- 4283
100 267k 100 267k 0 0 296k 0 --:--:-- --:--:-- --:--:-- 296k
OK
$ sudo apt-get update
$ sudo apt-get install cassandra

This error indicates that APT was not able to find a source for the package:
E: Package 'cassandra' has no installation candidate
The cause for the error is that you added the wrong repository in your sources:
deb [arch=amd64] https://downloads.apache.org/cassandra/debian 311x main
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:
$ sudo rm /etc/apt/sources.list.d/cassandra.sources.list
$ echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
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:
$ sudo apt-get install cassandra=3.11.11-1
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

Related

Can't install pgadmin4 repository does not have file

I was use command
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
But I was got this
Err:2 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release
404 Not Found [IP: 87.238.57.227 443]
Hit:3 https://community-packages.deepin.com/printer eagle InRelease
Hit:4 https://home-store-img.uniontech.com/appstore deepin InRelease
Reading package lists... Done
E: The repository 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
So I can't install pgadmin
Use Deepin linux 20.2.3
I am using Linux mint, issue has been fixed using the below command.
$ sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
$ sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main" \
> /etc/apt/sources.list.d/pgadmin4.list && apt update'
$ sudo apt update
And then, if you want desktop
$ sudo apt install pgadmin4-desktop
OR the web version:
$ sudo apt install pgadmin4-web
$ sudo /usr/pgadmin4/bin/setup-web.sh
# apt-get install curl ca-certificates gnupg
# curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
#vim /etc/apt/sources.list.d/pgdg.list
####### ADD
#deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
# apt-get update
# apt-get install pgadmin4 pgadmin4-apache2
It should now be successfully installed.
The problem is that lsb_release -cs is not returning the codename for Deepin linux, instead is returning n/a.
Try with that dpkg --status tzdata|grep Provides|cut -f2 -d'-' to retrive the codename.
If you want a oneliner like the one you posted, here you have:
sudo sh -c 'curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add && echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(dpkg --status tzdata|grep Provides|cut -f2 -d'-') pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
For Ubuntu 22.10 and other versions that complain about apt-key being deprecated, use this:
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
Note that "jammy" is being used here in the ftp link. You may browse through the other versions and pick the one that matches your Ubuntu installation's version
sudo apt install pgadmin4
This installs both web and desktop versions.
I experienced this error trying to upgrade my pgadmin4 to version 6. There was a problem with the certificates on my system I think, the solution was updating ca-certificates, if it's not installed you should probably install it, but that may be very unlikely that it's not installed though as it should already be there, but either way just run the command:
sudo apt install ca-certificates
I had the same problem with Debian 11, however exploring options I found this answer enter link description here and fixed the problem by installing lsb-release

Deepin 20 and updated Nodejs

Does anyone have a solution to get current node / npm versions on Deepin 20?
When trying to install from nodesource I get this:
Confirming "n/a" is supported...
curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/n/a/Release'
Your distribution, identified as "n/a", is not currently supported,
please contact NodeSource at
https://github.com/nodesource/distributions/issues if you think this
is incorrect or would like your distribution to be considered for
support
Although Deepin 20.2 can install Node JS directly from the apt, the version is too old and not maintained anymore.
In addition, the official installation method of NodeJS is problematic as it does not support the Deepin system.
So you need to look at this script setup.14.x to find the actual installation method. Of course, it might be simpler if you already have it installed on Debian or Ubuntu.
You have to completely uninstall Deepin's own version before installing the official version.
sudo apt remove nodejs npm
sudo apt autoremove
Add the following content to
/etc/apt/sources.list.d/nodesource.list:
deb https://deb.nodesource.com/node_14.x buster main
# deb-src https://deb.nodesource.com/node_14.x buster main
Then add the official key and you can install it directly.
curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
sudo apt update
sudo apt install nodejs
Problem fixed with Experience.
Deepin isn't listed as a supported distro for NodeSource.
As a Debian derivative, something like this should work:
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs
Otherwise you might try a manual install. If you do, you'll need to specify the buster codename since Deepin 20 is based on Debian 10.5.
This is what worked for me to install NodeJS 12. Paste in terminal the following
VERSION=node_12.x
DISTRO="$(dpkg --status tzdata|grep Provides|cut -f2 -d'-')"
echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs
this should work for Deepin 20

Issue "Could not fetch/save url https://download.docker.com/linux/centos/docker-ce.repo"

I am trying to set up the Docker repository on CentOS, after I run the command
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
I am getting error message:
Could not fetch/save url
https://download.docker.com/linux/centos/docker-ce.repo to file
/etc/yum.repos.d/docker-ce.repo: [Errno 12] Timeout on
https://download.docker.com/linux/centos/docker-ce.repo: (28,
'Operation timed out after 30005 milliseconds with 0 out of 0 bytes
received')
I am following the docker documentation to set up the repository.
Step 1: Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Step 2: Use the following command to set up the stable repository.
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Expected result: System should download the files.
Actual result: Not able to download the files.
I have the same problem but I solved it by updating the yum config file, just add timeout=120 to /etc/yum.conf:
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
#add timeout here
timeout=120
Set timeout to 2 min (or 3 min = 180), restart the server then re-run your command.
NOTE: you need to edit the yum.conf file as a super user in order to be able to save your changes.
To switch to super user run next:
sudo -i
To edit your file and save the changes use the nano editor (or Vi).
I think that it is not necessarily a good solution but it worked well for me.
Should help!
By adding this to my /etc/yum.conf file
add timeout here
timeout=300.
It fixed the problem.
In my case, I followed instruction in https://unix.stackexchange.com/a/568590/506588 to set
ip_resolve=4
in /etc/yum.conf [main] section then it works fine
If you face any error while trying to create a stable docker repo, You may use the following command.
Command:
curl --silent -SL https://get.docker.com/ | sh
If nothings works, then just do
wget https://download.docker.com/linux/centos/docker-ce.repo ; mv docker-ce.repo /etc/yum.repos.d/.
Go to https://download.docker.com/linux/centos/docker-ce.repo to download the file manual then upload it to /etc/yum.repos.d/docker-ce.repo
its just because ipv6 is still not completely deployed due to which we get timeouts or slow response.
just disable your system's/VM's ipv6 and it will work fine.
to disable the IPv6 use following commands (run as root or use sudo):
echo -e 'net.ipv6.conf.all.disable_ipv6 = 1 \nnet.ipv6.conf.default.disable_ipv6 = 1' > /etc/sysctl.d/disable_ipv6.conf
sysctl -p
systemctl restart systemd-sysctl.service
then run
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
check repositories:
yum repolist
install docker:
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

yum install mongodb on aws linux fails: no package available

Purpose
I'm trying to install mongodb on EC2 AWS x86_64 GNU/Linux via Yum.
Prerequisites
I created a /etc/yum.repos.d/mongodb.repo file and tried all the available combinations for it's content found on the official documentations and on the related questions on stackoverflow link1 link2 link3, for example:
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
(...tried with enabled=0, gpgcheck=0 too)
I also added a /etc/yum.conf file like this:
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
Problem
I'm getting the same output when running
sudo yum install mongodb-org (or by specifying the packages sudo yum install mongo-org mongo-org-server or by specifying the versions too sudo yum install -y mongodb-org-3.2.13 mongodb-org-server-3.2.13 mongodb-org-shell-3.2.13 mongodb-org-mongos-3.2.13 mongodb-org-tools-3.2.13)
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
No package mongodb-org available.
Error: Nothing to do
Question
What am I missing? Is there any additional dependencies?
You don't need to create a new /etc/yum.repos.d/mongodb.repo or at the time of this answer /etc/yum.repos.d/mongodb-org-3.6.repo cause it already exists but it is empty.
You can check with: cat /etc/yum.repos.d/mongodb-org-3.6.repo.
all you need to do is open the file on vi editor:
$ sudo vi /etc/yum.repos.d/mongodb-org-3.6.repo
~
~
add this code to the repository file. The one i provided is for the MongoDB 3.6 but you can find the one for earlier versions in the documentation:
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
To save and exit from vi editor check here or go ahead and do this:
ESC + :wq
After that you can proceed with the steps in the documentation or in the old C9 Forum, but here they are just in case:
$ sudo yum install -y mongodb-org
$ sudo mkdir -p /data/db
$ echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$#"' > mongod
$ chmod a+x mongod
You can start mongodb by running the mongod script on your project root:
$ ./mongod
The last command might not run the mongodb local server, and you can find the solution for that here or just go ahead and run these two commands:
$ sudo service mongod stop
$ sudo mongod
The only error I can spot is the space in "name" :
name=MongoDB Repository
With the naming changed to name=MongoDB, I did a test with CenOS 7 :
# yum search mongodb-org
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00
.
mongodb-org-3.4 | 2.5 kB 00:00
updates | 3.4 kB 00:00
(1/5): mongodb-org-3.4/primary_db | 30 kB 00:00
.
=========================== N/S matched: mongodb-org ============
mongodb-org-debuginfo.x86_64 : Debug information for package mongodb-org
mongodb-org.x86_64 : MongoDB open source document-oriented database system
: (metapackage)
mongodb-org-mongos.x86_64 : MongoDB sharded cluster query router
mongodb-org-server.x86_64 : MongoDB database server
mongodb-org-shell.x86_64 : MongoDB shell client
mongodb-org-tools.x86_64 : MongoDB tools
So I guess you can now install ``mongodb-org´´.
The problem was that I wanted to do it from the default ec2_user/ home folder. You need to cd .. up to the root, and locate the etc/yum.repos.d/ folder there.
For those of you finding this error after running an ARM AMI Linux 2 image, simply install the RPMs directly from the testing repository, which is the only one that supports all binaries on Amazon AArch64:
https://repo.mongodb.org/yum/amazon/2/mongodb-org/testing/aarch64/RPMS/
For example, to install the latest mongo shell:
sudo yum install -y https://repo.mongodb.org/yum/amazon/2/mongodb-org/testing/aarch64/RPMS/mongodb-org-shell-4.4.4-0.1.rc1.amzn2.aarch64.rpm
There is a dedicated repository for AWS Linux now.
Follow the instructions from https://docs.mongodb.com/master/tutorial/install-mongodb-on-amazon/
e.g.
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
I had this happen when my install commands specified sudo yum install mongodb-org-tools-4.0.18, but yum list available | grep mongo showed only 3.6 was available. So I did sudo yum install mongodb-org-tools and that worked.
I think you try to add exclude directory from /etc/yum.conf to prevent future updates
for example:
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
But above line need to be added after perform install mongodb-org:
sudo yum install -y mongodb-org

How to install Mono 4.0.1 on Debian 8?

I am attempting to install Mono-Complete onto a fresh brand new installation of Debian 8 in order to use ASP.NET 5 as per (code.visualstudio.com/docs), have followed the mono-project.com documentation for Ubuntu 12.04/Debian 8 or later with regards to the second repository that is needed.
However, after following the instructions and attempting to do 'apt-get install mono-complete' I end up with the following issue: http://puu.sh/hxdLB/dbecbf9645.png
This is on a 100% fresh Debian 8 VM (Virtualbox), just finished installing Debian 8 NetInst + Cinnamon, logged into the system as root and added the 2 repos.
If I try and manually install one of those dependencies (such as mono-devel) it comes up with an even bigger list of unmet dependencies that won't be installed.
I resolved this by following article posted by Alexander but also installed one more package monodevelop.
Following commands i run to install mod mono on debian 8.0 jessie:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete
To get development IDE run:
sudo apt-get install monodevelop
After then can successfully run : sudo a2enmod mod_mono_auto
There was an issue with the Mono packages that should now be resolved, please see http://www.mono-project.com/docs/getting-started/install/linux/#libgdiplus-debian-80-and-later-not-ubuntu.
The reason is that Debian 8 doesn't have libjpeg8 anymore which libgdiplus (a component of Mono) requires.

Resources