[Linux] You do not have root privileges. But I want to yum install.

Target audience

・ Beginners who started to touch Linux ・ Organization members who have been touched as such but have been robbed of Sudo


that is impossible. yum install will not work without sudo privileges. We strongly recommend that you contact your server administrator to install the required modules.

 $ sudo yum install gcc #=> "username" is not in the sudoers file.

But don't be discouraged. There are ways to get similar results without using yum.

Getting started: What is Yum install?

When installing software or libraries on Linux ――Determine the "installation location" (** path ) --Collects "other parts required for installation" ( resolves dependencies **) It does a job called ** package management **.

If I try to do this myself, I visit the page where the software is located on the Internet, directly specify the URL with softwarename.tar.gz, extract it, and run the installation file with the prefix ... Moreover, when I tried to move it, it was said that "Please install this package" and "This package version is not supported".

You need root privileges to run yum install, which will bring you this tedious task in almost perfect condition with the "Come on" instruction. Only when you lose root will you realize its importance. If you've arrived at this article, you're in that state right now.

Install linuxbrew

yum usually installs the software in a folder directly under the root directory. For example, / usr / bin is usually "in the path" from the beginning, and commands can be used to update installed software. Neither the ls command nor the cd command can be executed unless they are all "in the path".

$ whereis ls #=> ls: /usr/bin/ls

If you don't have write permission (sudo) to root privileges, you can install various packages in your home directory (/ home / username /, or ~ /, or $ HOME). Homebrew was born from this idea, and Linuxbrew.

However, this Linuxbrew itself has a dependency, and some libraries need to be installed by a user with root privileges in advance. Before you have a headache, let the administrator know what's going on and aim for an immediate solution. (I can't deny the feeling that I wouldn't have a hard time if I could do this in the first place ...)

Dependency installation

sudo yum groupinstall 'Development Tools'
sudo yum install curl file git
sudo yum install libxcrypt-compat # needed by Fedora 30 and up

Linuxbrew installation

$ git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew
$ mkdir ~/.linuxbrew/bin
$ ln -s ~/.linuxbrew/Homebrew/bin/brew ~/.linuxbrew/bin
$ eval $(~/.linuxbrew/bin/brew shellenv)

important point -Some libraries are not supported by Linuxbrew. -Once the first dependency is resolved, it can be installed and executed without affecting the directory that is the root area.

Recommended Posts

[Linux] You do not have root privileges. But I want to yum install.
[AWS EC2] Settings you want to do on Amazon Linux 2
I want to do ○○ with Pandas
I want to know if you install Python on Mac ・ Iroha
I want to know how LINUX works!
What to do if you have installed PyCharm but shortcut keys such as `control + e` do not work
Load NEologd from MeCab if you do not have installation privileges (Windows)
Let's summarize what you want to do.
I have a private Python package but I want to install pipenv on GitHub Actions and build a Docker Image
I want to do Dunnett's test in Python
I want to have recursion come to my mind
I want to do pyenv + pipenv on Windows
I want to log file I / O on Linux
Do you want me to fix that copy?
I want to save a file with "Do not compress images in file" set in OpenPyXL
What to do if you can't pip install mysqlclient
I want to scroll the Django shift table, but ...
I want to refute "Ruby is not cool here"
I want to install a package of Php Redis
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
[ML Ops] I want to do multi-project with Python
I want to do something in Python when I finish
I want to do Wake On LAN fully automatically
Super easy molecular phylogenetic tree creation technique that I do not want to teach anyone
I want to use the latest gcc without sudo privileges! !!
I want to install a package from requirements.txt with poetry
What to do if you can't log in as root
When you want to use python2.x on modern Gentoo Linux
What to do if you can't use WiFi on Linux
I have libncurses but get angry with pip install readline
I want to specify a file that is not a character string for logrotate, but is it impossible?