Linux server sudo command not found - ruby

I am having Linux server with
2.6.32-673.8.1.lve1.4.3.el6.x86_64 - GNU/Linux
and trying to run following commands :
sudo apt-get update
-bash: sudo: command not found
I have also tried - sudo su
-bash: sudo: command not found
And for lsb_release -a
-bash: lsb_release: command not found
I am trying to install ruby. Any help is highly appreciated.

sudo is in its own package. You probably don't have it installed, so you'll have to login as root and install it.

Sadly, just showing the kernel version doesn't help much, so see if this returns anything: cat /etc/*-release
If it does, you could be using something like CentOS or any other flavor of linux, so apt-get may not work anyway.
Hopefully, you are logging in with root if sudo isn't available. Running whoami should let you know your username if you are not sure.
If you are root, then try (for CentOS) yum install sudo to get sudo or just yum install ruby to install Ruby. If yum is not found, then try apt-get. If that still doesn't work, then you could be using a system with a different package manager (like emerge for Gentoo Linux).
EDIT: Does anything happen if you try /sbin/sudo (or /usr/sbin/sudo)?

Often sudo is not installed by default on distributions like Debian.
Tipe into the console:
su -
After that try to install sudo with this line:
apt-get install sudo -y
To use sudo properly you should give yourself Superuser permissions:
usermod -aG sudo USERNAME
After this step reboot your device and everything should work fine.

Related

Can i install Rstudio in kali linux?

I have installed anaconda on my kali linux OS. I am getting Rstudio as an option to install on navigator but when I click on it, it just loads and there is no progress. I even used terminal to do so, but it just points out some problems and is unable to fix it. I can't even find an option on Rstudio website to install for kali linux OS.
Use the following command to install Rstudio on Kali linux:
sudo apt update<br>
sudo apt -y upgrade<br>
sudo apt -y install r-base<br>
wget https://download1.rstudio.org/desktop/debian9/x86_64/rstudio-1.2.5042-amd64.deb<br>
sudo apt install ./rstudio-1.2.5042-amd64.deb<br>
If you encounter any dependency problems, run:
sudo apt -f install
For starting Rstudio, run:<br>
$ rstudio
Source: https://computingforgeeks.com/how-to-install-r-and-rstudio-on-ubuntu-debian-mint/

Shell driver install with `ACCEPT_EULA=Y` error

As described here, I am trying to install the following driver in shell, using this code (modified from the original slightly):
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/debian/8/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
But I get an error on the last command:
sudo: sorry, you are not allowed to set the following environment variables: ACCEPT_EULA
After searching, I can't seem to find this exact error anywhere else.
One solution is to run the last command without ACCEPT_EULA=Y as sudo apt-get install msodbcsql17. And then to enter Y at the prompt. This indeed works but I would like to run the above installation for other users without need of their input.
Is there a way to resolve the above error so I can use ACCEPT_EULA=Y, or
alternatively is there a simple way to enter the Y response for the EULA
automatically so the end user never needs to take any action?
Thank you in advance.
You appear to have access to run arbitrary commands, but not to modify the environment.
The simple workaround is to hand off environment changes to the command:
sudo env ACCEPT_EULA=Y apt-get install msodbcsql17
I don't have enough rep to post a comment.
But I was doing the same install for pyodbc inside a python:3 docker container.
In the dockerfile the following command works:
ACCEPT_EULA=Y apt-get install -y msodbcsql17
(I was after this particular driver #17.)
Reading: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/pyodbc/Dockerfile can help see the environment set up from a base ubuntu (ubuntu:16.04) box.
Also check up on: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017
for microsoft first hand docs.
The ACCEPT_EULA=Y apt-get install -y msodbcsql17 command above did the trick for me as I was trying to set up msodbcsql17 via a Dockerfile.

ejabberdctl not found in bash Ubuntu(installing ejabberd)

I was trying to install ejabberd with applying the tutorials in many site to my VM which is ubuntu but I am stuck in the beginning. After I wrote
sudo apt-get update
sudo apt-get -y install ejabberd
it installs ejabberd. But when I try to write the following
ejabberdctl register admin localhost mypassword
it says ejabberdctl not found. I also tried to restart it with but it is still same.
sudo service ejabberd restart
Note: I did not install erlang seperately. Can it be the problem?
Try sudo ejabberdctl,
if it didn't work, Do:
sudo updatedb
sudo locate ejabberdctl
check if the output is in your $PATH variable.

Installing MongoDB

I get this error when installing MongoDB on OSX, even though the second time I tried it with sudo command. Any thought?
==> Checking out tag r3.0.3
==> ./build.sh
==> /usr/local/opt/scons/bin/scons install --prefix=/usr/local/Cellar/mongodb/3.0.3 -j4 --osx-version-min=10.9 --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --use-new-tools
Error: Permission denied - /usr/local/var/mongodb
Monas-MacBook-Pro:meanio mona$ sudo brew install mongodb
Password:
Error: Cowardly refusing to `sudo brew install`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
It's a permissions problem. The solution being:
sudo chown -R `whoami` /usr/local/var/mongodb
Per the comment:
Try creating the directory, prior to setting ownership:
sudo mkdir /usr/local/var/mongodb && sudo chown -R `whoami` /usr/local/var/mongodb
I just open /usr/local/ via finder and manually create folder with name var. Mac asked for a password. After that I successfully install MongoDB.
You shouldn't use brew with sudo. To check the overall brew sanity, run:
$ brew doctor
It will pinpoint potencial problems and it's corresponding solutions. If it really is a permission problem, as pointed by #hd1, you should fix the permissions of /usr/local/var/, where brew is trying to create the /mongodb folder.

Can't find setsebool / getsebool in Fedora 20

Due to SELinux keeps preventing symlinks in /var/www/html/ to /home/<user>/path/to/project/in Fedora 20, I have to use setsebool / getsebool to let SELinux allow httpd to enable homedirs (using $ setsebool -P httpd_enable_homedirs 1 according to sealert). But it seems that Fedora 20 doesn't have this tool installed.. I only got command not found..., and I can't find in which package those tools ships with, so I can yum install it..
Are those tools obsolete or do I have to install additional package? Another suggestions to solve the symlinks issue (no, I don't accept $ sudo chmod or whatsoever has to do with changing permissions) are welcome too.
Answer
It seems that you have to log in to the terminal as root, in case you have policycoreutils already installed:
$ sudo -i
[sudo] password for <root username>:
$ getsebool <whatever>
$ setsebool <stuffs>
They're in the policycoreutils package, which you can install with yum:
sudo yum install policycoreutils
Alternatively, an easy way to install a file when you don't know what package it's in is to just ask to install the file, for example:
sudo yum install /usr/sbin/setsebool

Resources