Cannot install package via Miniconda: write permission - miniconda

I made a silent installation of Miniconda as root and then added write permission to a regular user, that cannot install packages:
If I try - as regular user:
conda install -y -c bioconda covtobed
I get this error:
EnvironmentNotWritableError: The current user does not have write permissions to the target environment.
environment location: /virome/tools/Miniconda_Shared
uid: 1982
gid: 1982
But the following commands work:
touch /virome/tools/Miniconda_Shared/test.write
touch /virome/tools/Miniconda_Shared/pkgs/test.write
rm /virome/tools/Miniconda_Shared/test.write /virome/tools/Miniconda_Shared/pkgs/test.write
What should I check (in terms of permission) to fix this?

Found here: https://docs.anaconda.com/anaconda/install/multi-user/
sudo chgrp -R $SHAREDGROUP $PATHTOCONDA
sudo chmod 770 -R $PATHTOCONDA

Related

docker-compose:The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user

I'm running 5 docker containers on Ubuntu 22.04. I have created a user and added to the group and logged in by
sudo su 'user'
I have installed virtualenv and running inside of it. All my commands are without sudo.
When i run docker-compose.yml , i see 2 warnings which are as follows:
1.The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag
2.Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
When i run the commands, there is clearly
(myEnv)user#instance-2:~/okuna-api$
which means the venv is activated.
I have already done the following :
sudo addgroup mygroup
sudo adduser user mygroup
sudo chown -R user:mygroup /home/user
sudo chmod -R g+rwX /home/user
sudo chmod 777 /var/run/docker.sock
This is a continuation to my question which isn't answered yet :
Django rest API : Python command-line .py execution: Stuck at a certain place
The core issue seems the permissions to the /root folder. I'm unable to find the right command to enable the user with read and write permissions to the root folder. Also,the docker group is created and I have already tried the following after adding user to the docker group:
sudo chown -R user:mygroup /root/.cache/pip/
But the warning still persists. I can't figure what else to do.kindky help.

Trying to Update Python 3 Using Homebrew

'''
(base) Kiefer's Macbook Pro:~ kiefergallant$ brew upgrade python3
Error: The following directories are not writable by your user:
/usr/local/share/man/man8
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/man/man8
And make sure that your user has write permission.
chmod u+w /usr/local/share/man/man8
(base) Kiefer's Macbook Pro:~ kiefergallant$
'''
Having a hard time updating python3 so I can use Tkinter

sudo: command not found when I ssh into server

I am a newbie with server handling and Linux. I am trying to install composer on my server so that i can host my Laravel project onto it as mentioned in the tutorial in Ultimate Guide: Deploy Laravel 5.3 App on LEMP Stack. I ssh into the server and after installation of composer when I run sudo mv composer.phar /usr/local/bin/composer I am getting a message in the terminal:
-bash: sudo: command not found
I desperately need some deliberate help
Sudo is probably not installed or not in your path
check to see if you are root in this case sudo is not needed unless you are trying to impersonate another user. just run your command without sudo mv composer.phar /usr/local/bin/composer
See if sudo is your path by running which sudo or echo $PATH. If sudo is not in your path, your path variable might be broken. You can try testing this by executing a common location for sudo /usr/bin/sudo or running locate sudo | grep bin to attempt to find its location.
If you know that sudo was installed, or your path looks broken, try fixing your path. Check your distribution's env file (/etc/environment in ubuntu) to make sure that it is formatted correctly (script commands are illegal in this file)
If you are not root and you want to run a command with root prvileges then you must install sudo. But if you don't have sudo and you are not root then you can't install it. In this case I recommend switching to the root user with su
If you do not have the root password and you own the machine, you can reset the root password with a tutorial such as https://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password
After you manage to login as root install sudo with apt-get update; apt-get install sudosince you are using Ubuntu.
Verify the the name of your sudoers group with visudo and modify your sudoers file if you need to. https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file-on-ubuntu-and-centos
if you have an existing sudoers group or you create one you can add yourself to the group. For example if your sudoers group is called sudo run usermod -aG sudo myuser. The sudoers group by default in Ubuntu based Linux is sudo. A sudoers group entry looks like this: %sudo ALL=(ALL:ALL) ALL
If you are trying to impersonate another user and cannot install sudo, you can still use su if it is installed and you have permission / password for the other user.
e.g. su someuser
As suggested in this post, you may have to install sudo in your server.
To do that, log in as root with the following command: su -. Then install sudo with your package manager (if you're in Ubuntu: apt-get install sudo).
Then add your user to the sudo group: usermod -aG sudo <username>.
Finally type exit to log out of the root account and go back to your user.
try to install your sudo using by first logging in as a root(su - ) and then try to install **apt-get or yum sudo **. Make sure your path variable is set so that you would be able to get binary.
which sudo
echo $PATH

Running conda install as an admin on my ubuntu server, I get "Missing write permissions: /home/ubuntu/anaconda3"

I have installed Anaconda3 on my ubuntu server.
When I attempt to install or upgrade any package using conda, for example:
conda install numpy=1.11.0
(of course you cannot do "sudo conda")
I receive the following error:
Error: Missing write permissions in: /home/ubuntu/anaconda3
#
# You don't appear to have the necessary permissions to install packages
# into the install area '/home/ubuntu/anaconda3'.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_root --clone=/home/ubuntu/anaconda3
As #cel pointed out, providing the correct permissions is all that is necessary:
sudo chown -R ubuntu /home/ubuntu/anaconda3
sudo chmod -R +x /home/ubuntu/anaconda3

Installation Node v4.1 with NVM - Permission denied

I have to install Node v4.1.x on Ubuntu. I have already installed it but with the wrong version. This are the steps that I followed untill now:
Installation of nvm
sudo git clone https://github.com/creationix/nvm.git /opt/nvm
sudo mkdir /usr/local/nvm
sudo addgroup -system dev
sudo chown -R root:dev /usr/local/nvm
sudo chmod -R 775 /usr/local/nvm
sudo vim /etc/profile.d/nvm.sh
Editing of the file
export NVM_DIR=/usr/local/nvm
source /opt/nvm/nvm.sh
export NPM_CONFIG_PREFIX=/usr/local/node
export PATH="/usr/local/node/bin:$PATH"
Installation of Node
sudo mkdir /usr/local/node
sudo chown -R root:dev /usr/local/node
sudo chmod -R 775 /usr/local/node
nvm stable
For installing node v4.1.x this is what I want to do:
nvm ls //list of all version
nvm use 4.1.x //if I find the correct version in the list
The problem is that I can't make nvm ls because I get
mkdir: cannot create directory ‘/usr/local/nvm/alias’: Permission denied
What can I do?
I think you might change NVM_DIR to:
NVM_DIR="$HOME/.nvm"
The problem is that you've installed nvm using root user (with sudo). When executing nvm commands later:
nvm ls
nvm use 4.1.x
you do this without root and you get a permission denied.
Generally it is not recommended to install nvm using super user.
Please check this article for more details on how to install the version manager: http://rainsoft.io/install-node-like-a-boss-with-nvm/
This can also be because of issues during the curl installation.
Try reinstalling using
sudo apt-get install build-essential libssl-dev curl git-core
In your case issue because you gave 755 permission to the nvm folder. So it cant create folder without write permission as non root user.
Solution is you should be a root user or else give write permission for the folder to your particular user.
I too faced the same issue while installing nvm
ubuntu#ip-10-0-0-94:~$ nvm install 6.0.0
It reported as,
nvm install 6.0.0 mkdir: cannot create directory ‘/home/ubuntu/.nvm/bin’: Permission denied
grep: /home/ubuntu/.nvm/bin/node-v6.0.0-linux-x64/node-v6.0.0-linux-x64.tar.xz: No such file or directory Binary download failed
It with the 755 permission before.
drwxr-xr-x 4 root root 4096 Jun 23 07:44 .nvm/
Then I just gave write permission for it.
sudo chmod +w .nvm
Now issue was resolved and working fine.
ubuntu#ip-10-0-0-94:~$ nvm install 6.0.0
Downloading https://nodejs.org/dist/v6.0.0/node-v6.0.0-linux-x64.tar.xz...
######################################################################## 100.0%

Resources