Problem running Android Studio on Ubuntu 20.04 terminal [duplicate] - android-studio

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
Improve this question
I installed go on ubuntu 16.04 from the archive and tried to test my installation by issuing the command go on my terminal. It keeps prompting me / not root-owned 1000:0.
I installed go on /usr/local folder and also included it into my path as instructed on the official golang installation. I removed go and tried to install it again, but found the same result. It sounds more of a linux root permission issue, but I have no clue how to fix it. I tried other commands that I installed from archive and they work perfectly fine. Any kind of help would be appreciated.

It seems to complain that the system root directory / has the wrong owner. This is a security problem because you don't want to have regular users changing system files at will. It looks like you changed this on purpose at some point in the past; change it back, or reinstall your system if you have wrecked more permissions than just this one.
sudo chown root /
For the record, the proper way to give yourself limited system access is to use sudo. Add yourself to sudoers (usually this is already set up by the OS installer on any reasonably consumer-oriented Linux distro) and when you need privileges for something, run that command with sudo.

Simple, in the command line:
sudo chown root:root /

In addition to the root permission issue I had, I also found that I installed go using snap to: snap install --classic go, which wasn't a good idea. I was also unable to remove the go folder in /snap, even as root. I now reinstall my system and hopefully the issue will be solved.

sudo chown root /var
This will solve your problem

Related

python 2.7 not working when I use it with sudo [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to install python2.7 on a VM which is centos 6.5. I followed a following guide to install it
http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/
However when I try to install run python as sudo i get the following error.
-bash: python2.7: command not found
running just python2.7 works. It even works when i run it as a root user. Also I noticed that:
which python2.7
returns
/usr/bin/which: no python2.7
when I do sudo -i and then run the command.
Any idea why it is like that?
If you're using CentOS 6.5, this is likely due to the fact that sudo does not set /usr/local/bin as part of the PATH.
CentOS 6.x's /etc/sudoers file sets the secure_path (which is used during sudo sessions) to a very restricted set of paths.
Use the visudo command and look at the contents of your /etc/sudoers file. You will likely find this section:
#
# Adding HOME to env_keep may enable a user to run unrestricted
# commands via sudo.
#
# Defaults env_keep += "HOME"
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
So sudo doesn't use the /usr/local/bin path.
You can solve your problem in a couple ways:
Add /usr/local/bin to the secure_path - This can open up security problems if you don't know what's gonna be in your /usr/local/bin directory. Though typically, this is probably not a huge concern because only root has write access to /usr/local/bin by default.
Disable secure_path entirely by commenting it out - again, you're overriding a feature designed to restrict access and improve security.
Try the following
sudo env PATH=$PATH python2.7
What this does is copy the current path you have into your new sudo's environment.

Completely uninstall openldap from Redhat Linux server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have performed the following steps to install OpenLdap on my Redhat Linux Server:
1. untar the tar file
2. ./configure <--this ran successfully without error
3. make depend
4. make
5. make test <-- couldn't find any error
6. make install
7. started slapd: /usr/local/sbin/slapd
But the service is not starting. I don't see any slapd process in the ps -lef | grep slapd output. Also I see this, when i run : ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
What could be the error and also How can I completely uninstall OPENLDAP
There are two questions here:
What could be the error?
It's possible that you haven't appropriately configured slapd. There are probably errors in your syslog (/var/log/messages) that will help you diagnose problems. You can also run slapd in debugging mode (slapd -d none) to see errors displayed on your terminal.
How can I completely uninstall OpenLDAP?
That's a little tricky, since you (a) elected to install it from source rather than using an existing package and (b) you didn't install it into a dedicated directory. To completely uninstall it, you would have to pay close attention to what files are installed by running make install and then remove them.
However, there's no harm in leaving the files installed on your system as long as you're not using them. You can remove anything that was installed into /usr/local/bin or /usr/local/sbin if you want to prevent them from conflicting with versions of those commands installed via system packages.
If OpenLDAP is the only thing you've installed in /usr/local you can just remove any files below that directory.
Generally, if you can use the pre-packaged versions of software available in your Linux distribution your life will be easier. For example, if you were to install the RedHat openldap-servers package, you would have a default configuration that would allow slapd to start and run correctly.
To uninstall. look through either the log output from the configure command, or type "configure --help" to see a list of directories that things are installed in by default. Most likely it populated files into /usr/local/bin, /usr/local/lib, and so forth, so you'll need to into those directories and remove the files by hand.

Change owner of the root folder and subfolders (Ubuntu 13.04) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I accidentally set owner of root folder (/) and all subfolders to one user by command
$ sudo chown -R 'userName' /*
Now I wanna set owner back to root user by command
$ chown -R root:root /*
But I have no permission for this operation.
If i use command
$ sudo chown -R root:root /*
it returns
sudo: effective uid is not 0, is sudo installed setuid root?
What should I do to fix that?
I am guessing when you ran the first command you also ended up modifying the ownership of the /usr/bin/sudo executable.
It is saying that effective UID isn't 0 (since root has EUID equal to 0).
So try to change owner of /usr/bin/sudo, and then try change the ownership of other files.
You broke your system pretty badly. Next time be more careful using sudo.
Now, start your system using a rescue disk, probably your install disk.
Mount your broken file system in the rescue system.
Fix the permission/owner stuff.
Reboot using your original system.
Depending on how much you changed using that chown, you will have to fix a lot in step 3. You probably might want to have a look at a working proper installation of the same system to find out which user should be the owner of things like /dev/mem etc.
A re-install of the OS might be faster.
:O I offer my condolence!
The problem is that the sudo binary itself must be owned by root. If you have the root password you could just get root to fix the problem:
su
If not, you could boot using a rescue system, mount the partition and
chown root:root /mnt/usr/bin/sudo
or fix the whole problem using the rescue system.
But it will be hard to fix all that ownerships. I would suggest to craft a script that reads the file ownerships from a vanilla installation of your system (having installed the same packages as you) and applies them to the crashed system. (Custom files in the /home/... you'll have to chown yourself) Without such a script it will get really hard but it should be easy to code that

Nothing happens when trying to install a .run file from the terminal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm new to linux. I have Ubuntu and I would like to run a .run installer in my Downloads folder. The name of the run file is "xampp.run"
I've read that you first have to run
chmod +x xampp.run
to change mode to installer and then run
./xampp.run
to run the installer. However, nothing happens when I try these. I'm running from root#ubuntu.
This is what I've done in my shell.
Download and install XAMPP for x86_64 Linux.
.run files are executables, not unlike windows-installers(M$)
You may need root permission to execute the file.
su to root, and enter the root password, or use sudo before your command
then either cd to the directory where the .run file is
or use "absolute addressing" and
type in a terminal shell...
sh (filename).run
Generally you can evoke a help screen (not always) by adding --help on the end.
sh (filename).run --help
(this may give you options to apply to the install script.)
Hope this helps
You should download 64bit version of Xampp.
this steps is for ubuntu user
sudo chmod 755 xampp-linux-1.8.2.0-installer.run
sudo ./xampp-linux-1.8.2.0-installer.run
(This will extract all the packages to the /opt/lampp directory)
Then start the service
/opt/lampp/lampp start

Linux console: git command not found on x64 Cent OS [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have a completely fresh install of 64 Bit Cent OS 5.7, this is in VirtualBox on top of 64-bit XP.
I'm trying to install SSU.
Problem: The command 'git' was not found. See "code" below please.
Have tried looking this up: /usr/local/git/ does not exist: git: command not found (on OS X 10.5)
I don't care about source code: I just want git to work so SSU will install so I can try to access the bank on what seems like a huge whim.
I am signed in to Gnome as root and seem to be able to access my computer normally without being harassed about passwords excessively and can create or edit files.
[root#localhost ~]# $ git clone https://github.com/wesabe/ssu
bash: $: command not found
Concerns
Unfortunately every single time I ask these kinds of questions and don't make clarifications I end up having to make those clarifications. So...
No negativity or rudeness intended what-so-ever: if the answer involves editing a text file or copy-and-paste actions please tell me the locations to do so in the file manager instead of console commands. I'm perfectly okay copying and pasting console commands for things that really should be done in the console though.
Note: there appear to be numerous "git" commands and numerous "ssu" commands. I do NOT know the difference between them and would really prefer someone who has solid expertise to answer so that I nor others end up accidentally trashing our copies of Linux as it's been very difficult to get anything to work and stay working thus extending my personal stay with XP.
I will be more than happy to both accept an answer and thumbs it up should it be helpful.
I would first try installing git. As root:
yum install git
According to here,
yum install git-core
If that doesn't work you could add the EPEL source. There are also RPMs for git.

Resources