File not executable.make it executable forcefully - linux

I just have downloaded gmtp source to connect android mtp device to my Ubuntu Linux 10.10. But when I enter command ./configure it says permission denied and chmod 0777 ./ configure is not making it executable. On double clicking it in nautilus I found that Ubuntu gives me warning that it is downloaded from untrusted source. Is there any solution to it.please help me as I am new to Linux.

chmod 0777 ./configure should work. You need to own the file though, if you don't, sudo chown yourusername configure (you might need to do sudo chown your_username -R . to acquire the whole directory recursively as .configure might need to read other files) or run the chmod command with sudo.

Related

Can't disable my Ipv6 in my ubuntu

I'm installing hadoop on my linux right now, so far I've installed and extracted hadoop, and set up my Java Home variable. I'm trying to disable my ipv6, but so far when I tried to save changes, it shows the following:
This is my command:
nano /etcl.systct.conf
Can this command work:
error writing /etc/sysct.conf: permission denied
You have to run command with sudo
Ex: sudo nano /etcl.systct.conf
Try doing it as superuser, add sudo when the permission is denied. Change the file permission using chown.
sudo chown 755 file name
sudo command file_name

Install Android Studio on Linux Mint 18.1 - Permission Denied

Trying to install Android Studio 2.3.0.8 for Linux on Linux Mint 18.1 (64bit) however it isn't working.
I have downloaded the zip; android-studio-ide-162.3764568-linux.zip -from https://developer.android.com/studio/index.html and followed the instructions in the user guide and other stackoverflow questions but it won't install.
The steps I take are:
(1) Extract android-studio-ide-162.3764568-linux.zip to /home/username/Downloads. I have also tried moving the folder (using terminal command sudo mv from/file /usr/local and to /opt/). However the result is always the same
(2) Run in terminal; cd ./Downloads/android-studio/bin or /usr/local, etc. then enter the command ./studio.sh
I have tried tried this a number of times but it still wont work. ;
"username#username-MS-7970 ~/Downloads/android-studio/bin $ ./studio.sh
bash: ./studio.sh: Permission denied"
Any help would be much appreciated.
sezpanda#sezpanda-MS-7970 /opt/android-studio/bin $ sudo ls -a
[sudo] password for sezpanda:
. idea.properties log.xml studio.vmoptions
.. inspect.sh os subprocess
appletviewer.policy libbreakgen64.so studio64.vmoptions sys
fsnotifier libbreakgen.so studio.png
fsnotifier64 lldb studio.sh
sezpanda#sezpanda-MS-7970 /opt/android-studio/bin $
Simply download .zip from official url i.e. android_studio & then check whether there is java installed or not on your system, to check simply do,
java -version
will return something like this,
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)
Then extract .zip & go to extracted zip folder & then go to bin, open your Terminal & perform these two step & Android Studio will get successfully installed on your system,
sudo chmod +x ./studio.sh
sudo ./studio.sh
You might not have chmod +x studio.sh try sh ./studio.sh
If this was not it, try again like this: sh -x ./studio.sh. This will show you every line that is run and will help you debug it.
Good luck.
sudo chmod +x ./studio.sh
sudo sh ./studio.sh

How to allow file & folder perminsion in Ubuntu 16.04.1 LTS

I have installed latest Ubuntu 16.04.1 LTS in my laptop to learn Ubuntu OS. Now I am trying to create files and folders inside /var/www/html directory but getting permission issue.
Can you please guide me which commands, I have to run to create files & folders.
Thanks
To get permissions, you'll have to prepend sudo to your command e.g. sudo mkdir /var/www/html/mywebsite. The first command you run with sudo will require your password.
You need root privileges.
Open terminal using Ctrl+alt+T
sudo mkdir /var/www/html/new_folder
This will crate a folder named new_folder in html folder
next type,
sudo touch /var/www/html/new_file
This will create file named new_file in html folder

Android Studio: /dev/kvm device permission denied

When I try to run my Android app on an emulator I get this error:
/dev/kvm permission denied.
I checked the permissions and added the user I am currently logged in with to the kvm group. What is wrong?
As mentioned in the comments, starting with Ubuntu 18.04 and Linux Mint Tara you need to first sudo apt install qemu-kvm.
To check the ownership of /dev/kvm use
ls -al /dev/kvm
The user was root, the group kvm. To check which users are in the kvm group, use
grep kvm /etc/group
This returned
kvm:x:some_number:
on my system: as there is nothing rightwards of the final :, there are no users in the kvm group.
To add your user to the kvm group, you could use
sudo adduser $USER kvm
which adds the user to the group, and check once again with grep kvm /etc/group.
As mentioned by #marcolz, the command newgrp kvm should change the group membership live for you. If that did not work, #Knossos mentioned that you might want to log out and back in (or restart), for the permissions to take effect. Or do as #nmirceac mentioned and re-login in the same shell via su - $USER.
This is how I got it to work in Ubuntu 18.04
sudo apt install qemu-kvm
Add your user to kvm group using:
sudo adduser <Replace with username> kvm
If still showing permission denied:
sudo chown <Replace with username> /dev/kvm
Try it.
Try this, it worked for me:
sudo apt install qemu-kvm
sudo chown -R <username>:<username> /dev/kvm
This is because /dev/kvm is not accessible. To make is accessible from android studio run the below command
sudo chmod 777 -R /dev/kvm
It will ask for your password. After that restart Android Studio.
KVM is required to rum emulator. If you have not install it yet then install it
sudo apt install qemu-kvm
Have you also tried following, it should work:
sudo chown <username> /dev/kvm
sudo chmod o+x /dev/kvm
sudo chown $USER /dev/kvm
Simply running that one command worked for me here in September 2019 running:
Description: Ubuntu 18.04.3
LTS Release: 18.04
Codename: bionic
Step 1: (Install qemu-kvm)
sudo apt install qemu-kvm
Step 2: (Add your user to kvm group using)
sudo adduser username kvm
Step 3: (If still showing permission denied)
sudo chown username /dev/kvm
Final step:
ls -al /dev/kvm
I am using ubuntu 18.04. I was facing the same problem. I run this piece of command in terminal and problem is resolved.
sudo chown $USER /dev/kvm
the above command is for all the user present in your system.
If you want to give access to only a specific user then run this command
sudo chown UserNameHere /dev/kvm
Under Ubuntu, the permissions of /dev/kvm usually look like this:
$ ls -l /dev/kvm
crw-rw---- 1 root kvm 10, 232 May 24 09:54 /dev/kvm
The user that runs the Android emulator (i.e. your user) needs to get access to this device.
Thus, there are basically 2 ways how to get access:
Make sure that your user is part of the kvm group (requires a re-login of your user after the change)
Widen the permissions of that device such that your user has access (requires a change to the udev daemon configuration)
Add User to KVM Group
Check if your user is already part of the kvm group, e.g.:
$ id
uid=1000(juser) gid=1000(juser) groups=1000(juser),10(wheel)
If it isn't then add it with e.g.:
$ sudo usermod --append --groups kvm juser
After that change you have to logout and login again to make the group change effective (check again with id).
Widen Permissions
Alternatively, you can just can widen the permissions of the /dev/kvm device.
Example:
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
FWIW, this is the default on other distributions such as Fedora and CentOS.
Check the effectiveness of the above commands with another ls. You should see output similar to:
$ ls -l /dev/kvm
crw-rw-rw-. 1 root kvm 10, 232 2020-05-16 09:19 /dev/kvm
Big advantage: You don't need to logout and login again for this change to be effective.
Non-Solutions
calling chmod and chown directly on /dev/kvm - 1) these changes aren't persistent over reboots and 2) since /dev/kvm permissions are controlled by the udev daemon, it can 'fix' its permissions at any time, e.g. after each emulator run
adding executable permissions to /dev/kvm - your emulator just requires read and write permissions
changing permissions recursively on /dev/kvm - I don't know what's up with that - looks like cargo cult
installing extra packages like qemu - you already have your emulator installed - you just need to get access to the /dev/kvm device
Here is a simple solution
open the terminal and run the following commands
sudo groupadd -r kvm
sudo gedit /lib/udev/rules.d/60-qemu-system-common.rules
Add the following line to the opened file and save it
KERNEL=="kvm", GROUP="kvm", MODE="0660"
Finally run:
sudo usermod -a -G kvm <your_username>
Reboot your PC and Done!
There's absolutely no need to install qemu-kvm (and all its dependencies) if you only want to run the Android Studio Emulator.
The only thing you have to do is to give your user (i.e. the one you are logged in with) the right to access the /dev/kvm-device.
This is done in three simple steps.
First:
Create the kvm-group
groupadd -r kvm
The option -r creates a system group, i.e. with a GID <= 999 (see /etc/login.defs => SYS_GID_MAX)
Second:
Change permissions on /dev/kvm. This could be done as part of the qemu-kvm-installation, because one of the dependencies is installing qemu-system-common (on current Ubuntu systems, package name may vary), which in turn installs the file /lib/udev/rules.d/60-qemu-system-common.rules containing the following:
KERNEL=="kvm", GROUP="kvm", MODE="0660"
So if you are just create a file /etc/udev/rules.d/60-qemu-permissions.rules containing the above line, you are done with the first step.
Third:
Add your username to the group by executing
usermod -a -G kvm <your_username> - the -a is important for adding your user to the kvm-group. Without that you will overwrite the group-settings for your user to only belonging to "kvm"...
That's it.
For the new udev rule and group setting to take effect it's easiest to reboot and login again.
You can also execute
udevadm control --reload-rules && udevadm trigger
for reloading the rules but you still have to logout and login again with regard to the new group.
I countered the same problem and to solve this issue just type the following commands in terminal for Linux clients
sudo apt-get install qemu-kvm
// type your password
sudo chmod 777 -R /dev/kvm
and after that try running simulator it'll work
sudo setfacl -m u:$USER:rwx /dev/kvm
Worked for me.
I am using linux debian, and i am facing the same way. In my AVD showing me a message "/dev/kvm permission denied" and i tried to find the solution, then what i do to solve it is, in terminal type this :
sudo chmod -R 777 /dev/kvm
it will grant an access for folder /dev/kvm,then check again on your AVD , the error message will disappear, hope it will help.
This Worked For Me on Linux (x18) ☑ Hope It Will Work For You Aswell
sudo chown hp /dev/kvm
Just one slight improvement on Jerrin's answer on fixing this error with Ubuntu 18.04 by utilizing $USER variable available in the bash terminal. So you could use the following commands two commands:
sudo apt install qemu-kvm
Add the current user to the kvm group
sudo adduser $USER kvm
Also if you are still having issues, one other problem for me was the way in which I installed Ubuntu. I made the mistake of checking the box during installation for installing 3rd party software which did not play nice with my nvidia graphics card for development. So I reinstalled Ubuntu with this third party software unchecked.
Then after installation, open up Software & Updates and go to the Additional Drivers tab. Select the most up to date proprietary drivers that have also been tested and apply changes. Should restart the machine for the changes to take affect.
What finally fixed it for me on Ubuntu 18.04 was:
sudo apt install qemu-kvm
sudo adduser $USER kvm
sudo chown $USER /dev/kvm
I tried sudo setfacl -m u:UserName:rwx /dev/kvm . and it works .
In the android studio you need to change : tools> avd manager >(chose the pen to edit your device and change 'graphics' from automatic to software ) to avoid emulator drawable error
Here is what I did:
user#user:~$ whoami
antonio
sudo apt install qemu-kvm
sudo adduser antonio kvm
sudo chown antonio /dev/kvm
last but not least
On Android studio
select File -> Restart IDE
to apply the changes
Then create the emulator
I was in a similar situation with the same error of permissions on /dev/kvm
I had done the necessary installations but not added the user to the kvm group
All I had to do was
sudo adduser <Replace with username> kvm
and ofcourse DON'T forget to restart your Ubuntu instance.
/dev/kvm permission denied android studio
[Motherboard]Set VT(Virtualization Technology) in BIOS and install Virtual Machine
I got this error after updating my ubuntu to 18.04.1. I just download new system image for emulator or you can say that download new emulator and it is worked for me.
Open Terminal and log as admin
sudo su
Go to the dev folder
cd /dev/
Change the kvm mode
chmod 777 -R kvm
Type in terminal:
sudo apt install qemu-kvm -y
sudo chown $USER /dev/kvm
Although KVM is a module built into the Linux kernel itself, it doesn't mean that all the necessary packages are included in your Ubuntu/Linux install by default. You'll need a few to get started, and they can be installed with this command in the terminal:
& sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager
Configure the network bridge
In order for your virtual machines to access your network interface and be assigned their own IP addresses, we need to configure bridged networking on our system.
First, run the following Linux command in order to find out what name your network interface has been assigned. Knowing this will allow us to do additional configuration later.
$ ip a
In my case, the network interface is called enp2s0. Yours will likely be very similarly named.
In order to tell Ubuntu that we want our connection to be bridged, we'll need to edit the network interfaces configuration file. Doing this won't negatively impact your connection at all. It'll just allow that connection to be shared with the VMs.
Use code (Visual Studio Code) or your favorite text editor to open the following file:
$ code /etc/network/interfaces
When you first open this file, it may be empty or contain just a couple of lines. Your bridge interface is called br0, so add the following line for the interface to come up by default:
auto br0
Below this line, add the following line for your current network interface (the one who's named you determined earlier).
iface enp2s0 inet manual
Next, you can add the bridge information. These lines tell Ubuntu that your bridge will use DHCP for automatic IP address assignment, and your bridge will manage your current interface.
iface br0 inet dhcp
bridge_ports enp2s0
This is how your file should look once all the changes have been applied (if you also have a couple of lines that were already there, it's fine to have them too):
Save your changes and exit the file.
Add your user to the groups
In order to manage your virtual machine(s) without root privileges, your user will need to belong to two user groups. Run the following commands to add your user to the appropriate groups (replacing user1 with the name of your user):
$ sudo adduser user1 libvirt
$ sudo adduser user1 libvirt-qemu
$ sudo adduser user1 kvm
When you're done, you should restart your system to ensure that all of the changes done to your user and network configuration have a chance to take effect.
In order to make a virtual device in Linux - I have to follow this three command and it helps me to avoid trouble for building avd devices - the process are -
sudo apt install qemu-kvm
sudo adduser $USER kvm
sudo chown $USER /dev/kvm
so, now you are good to go, restart android studio and start building application with emulator.
Provide appropriate permissions with this command
sudo chmod 777 -R /dev/kvm
Running the below command in Ubuntu 18.04 worked for me
sudo chown -R /dev/kvm
If you open your ide with sudo. You are not going to have this problem.

CoreOS - Unable to access /mnt due to Permissions issue on /var/lib/docker

Im trying to copy a file to a docker container using the /mnt but I get this weird error when trying to sudo into the docker folder on CoreOS.
Core User:
core#dockermanager ~ $ cd /var/lib/docker
-bash: cd: /var/lib/docker: Permission denied
Sudo:
core#dockermanager ~ $ sudo cd /var/lib/docker
sudo: cd: command not found
Anyone else encounter this/know the explantion?
Exec-Driver - native-0.2
Kernel 3.18.6
CoreOS 607.0.0
Thanks for all the comments as I am relatively new to the Docker environment.
It isn't an ideal way nor what I would choose to do, but Im trying to run a testing environment for Drupal and wanted to add a theme and FTP isnt available.
Run sudo -s and then cd /var/lib/docker.
Your first command doesn't work because the core user doesn't have permissions to access that folder. Your second command doesn't work because sudo is not running your command inside of a shell that interprets it like you expect.

Resources