Linux installing binary files

How to install node binary distribution files on Linux

My production server (Centos 5.9) won’t compile nodejs, possibly because it’s gcc is only 4.1.2 (4.2 or above is recommended) so I’ve trying to install the binaries.

$ wget http://nodejs.org/dist/v0.10.22/node-v0.10.22-linux-x86.tar.gz $ tar -zxvf node-v0.10.22-linux-x86.tar.gz $ cd node-v0.10.22-linux-x86 $ sudo cp bin/* /usr/local/bin $ sudo cp -R lib/* /usr/local/lib $ sudo cp -R share/* /usr/local/share 
$ node -v # => v0.10.22 $ man node # looks fine $ npm -v # UH OH, PROBLEM - Cannot find module 'npmlog' 

Now (keeping in mind I’m a complete beginner at node) I did some searching and found there’s an environment variable called NODE_PATH, so I tried:

$ export NODE_PATH=/usr/local/lib/node_modules $ npm -v # SAME PROBLEM - Cannot find module 'npmlog' 
$ find /usr/local/lib -name npmlog # => /usr/local/lib/node_modules/npm/node_modules/npmlog $ export NODE_PATH=/usr/local/lib/node_modules/npm/node_modules $ npm -v # DIFFERENT PROBLEM - Can't find '../lib/npm.js' 

At this stage, after more unhelpful googling, I decided I was in over my depth and decided to ask for help. Can anyone tell me what I’m doing wrong?

Comparing the linux files to those on my OSX dev machine where I had been able to install node successfully with brew, I noticed there was one file missing from /usr/local/lib/node_modules/npm and that was npmrc which contains just «prefix = /usr/local». However, adding this file to Linux had no effect.

13 Answers 13

It is much faster to do clean NPM reinstall which will remove «broken» links:

wget https://npmjs.org/install.sh chmod +x install.sh sudo ./install.sh 

Then it will ask you to remove old NPM link

This is the easiest solution I’ve found to install both npm and node . The n package makes managing Node.js a breeze.

Using Node Version Manager

Use a Node version manager like nvm to handle installation and version management for you. After you install nvm you can simply install any Node version, for example nvm install 8 .

But if you just want to install the binary yourself, see below:

Using apt-get

In special cases where you need a system wide Node installation, you can use apt-get:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs 

The above snippet will install the latest Node 8.

Installing the Binary Manually

In order to install the binary manually, all you need to do is to download the binary and create a bunch of symbolic links. Execute the commands below one after the other, and it should do the job. I have also written a shell script that does it for you if that is easier (see the bottom of the answer). Hope that helps.

Make sure to use the correct download link for your OS architecture (i.e. either 32-bit or 64-bit) for wget on the second line.

ME=$(whoami) ; sudo chown -R $ME /usr/local && cd /usr/local/bin #adding yourself to the group to access /usr/local/bin mkdir _node && cd $_ && wget https://nodejs.org/dist/v8.11.4/node-v8.11.4-linux-x64.tar.xz -O - | tar zxf - --strip-components=1 ln -s "/usr/local/bin/_node/bin/node" .. # Making the symbolic link to node ln -s "/usr/local/bin/_node/lib/node_modules/npm/bin/npm-cli.js" ../npm ## making the symbolic link to npm 

Here is a shell script that downloads and installs all the components. If you use this script to install Node, you can use the uninstall script to uninstall it.

#! /bin/bash # run it by: bash install-node.sh read -p " which version of Node do you need to install: for example 8.11.4 (or any other valid version): " VERSIONNAME read -p " Are you using a 32-bit or 64-bit operating system ? Enter 64 or 32: " ARCHVALUE if [[ $ARCHVALUE = 32 ]] then printf "user put in 32 \n" ARCHVALUE=86 URL=https://nodejs.org/dist/v$/node-v$-linux-x$.tar.gz elif [[ $ARCHVALUE = 64 ]] then printf "user put in 64 \n" ARCHVALUE=64 URL=https://nodejs.org/dist/v$/node-v$-linux-x$.tar.gz else printf "invalid input expted either 32 or 64 as input, quitting . \n" exit fi # setting up the folders and the the symbolic links printf $URL"\n" ME=$(whoami) ; sudo chown -R $ME /usr/local && cd /usr/local/bin #adding yourself to the group to access /usr/local/bin mkdir _node && cd $_ && wget $URL -O - | tar zxf - --strip-components=1 # downloads and unzips the content to _node cp -r ./lib/node_modules/ /usr/local/lib/ # copy the node modules folder to the /lib/ folder cp -r ./include/node /usr/local/include/ # copy the /include/node folder to /usr/local/include folder mkdir /usr/local/man/man1 # create the man folder cp ./share/man/man1/node.1 /usr/local/man/man1/ # copy the man file cp bin/node /usr/local/bin/ # copy node to the bin folder ln -s "/usr/local/lib/node_modules/npm/bin/npm-cli.js" ../npm ## making the symbolic link to npm # print the version of node and npm node -v npm -v 
#! /bin/bash # run it by: ./uninstall-node.sh sudo rm -rf /usr/local/bin/npm sudo rm -rf /usr/local/bin/node sudo rm -rf /usr/local/lib/node_modules/ sudo rm -rf /usr/local/include/node/ sudo rm -rf /usr/local/share/man/man1/node.1 sudo rm -rf /usr/local/bin/_node/ 

Источник

Читайте также:  Linux sed только цифры

How to Install or Execute a .bin File in Ubuntu Linux

Binary Files can be in .bin or .run files under Ubuntu Linux. and the .bin or .run is the only file types, and you need to mark as executable permission to install it on your Ubuntu system. You can install it either in terminal or through GUI.

Install Or Execute Bin File

This guide will introduce two methods to install executable file under Ubuntu Linux. And executable files can also be recognized by the extension .bin and .run.

Terminall Installation

Here are the steps to install .bin files via terminal on Ubuntu:

#1 you need to download the .bin file that you want to install.

#2 Open a terminal window by clicking the Ubuntu terminal icon located on the Launcher taskbar. and then searching for “Terminal” and then clicking Terminal icon on the result page. or you can right click on the desktop, and select Terminal from the popup menu list to open one terminal window.

#3 change the current directory to your directory where the executable file is stored. for example, you have downloaded .bin files into the /tmp directory. Then type the following command:

#4 You need to mark the file permission as executable with the following chmod command, type:

Then type the required password for root, and press Enter key. And the file can be executed by the current user with root privileges now.

#5 the bin file can be run in the terminal by typing the following command:

Читайте также:  Evolution mapi astra linux

If you hit an error message such as “permission denied”, and you can try to execute the file by adding sudo before the above command.

GUI Installation

You can also install the executable binary files via Ubuntu Desktop GUI. Here are the steps:

#1 Click the Files icon on the Ubuntu Launcher to start the File Manger and then change to the directory in which the executable file is stored.

#2 right click on the BIN file and select Properties from the popup menu list, and the Properties dialog will appear. then switch to Permissions tab, and check the Allow Executing File as Program. then click the Close button.

#3 double-click on the .run or .bin file. and if there is no any action appears to be happening, and you need to run it in the terminal.

Conclusion

You should know that how to install the executable binary file (.bin or .run) on your Ubuntu 14.04 or 16.04 or 18.04 Linux from this guide.

Источник

Как устанавливать bin файлы в Linux

Не смотря, на то, что большинство программ в операционной системе Linux (в моем случае Ubuntu) можно установить из Центра приложений, тем самым обеспечивая совместимость с системой, иногда вам может понадобится установить новую версию программы или наоборот, старую, которой может не оказаться в списке.

Такие программы чаще всего распространяются, в формате .bin также известные как бинарные файлы. Бывает, что они запакованы в архив, а иногда как исполняемые файлы. Установка bin linux, может быть произведена через терминал либо же через графический интерфейс. Рассмотрим оба варианта.

Установка bin файлов в Linux

Консольный вариант

1. Для начала в файловом менеджере, нужно найти наш бинарник.

Загрузки_007

2. Откроем терминал, сочетанием клавиш Ctrl+Alt+T.

Терминал_009

3. Зайдем в режим суперпользователя (под рутом). Для этого введем следующую команду в терминале:

Затем нужно ввести пароль.

Терминал_011

4. Теперь, в терминале нам нужно зайти в ту директорию, где расположен наш бинарник. В моем случае это будет так:

Терминал_012

5. Дайте права на выполнение файла .bin, командой:

В моем случае это выглядит так:

Терминал_014

6. Теперь выполните его. Для этого находясь уже в той директории, где находится бинарный файл введем точку и слэш, затем имя файла. В случае со мной это выглядит так:

Терминал_015

7. После этой команды, установщик программы запустился и спрашивает меня на каком языке я хотел бы установить bin файл в linux.

Language Selection_016

8. Далее устанавливаем программу как обычно это делается в ОС Windows.

Установка_017

Графический вариант

Он ненамного проще, но для новичков, которые недавно перешли с Windows будет понятнее. Первые 3 пункта из консольного варианта все же придется выполнить. Затем нужно выбрать файл, нажать правой кнопкой мыши, выбрать пункт «свойства». На вкладке права, нужно поставить галочку напротив пункта «Разрешить выполнение файла как программы».

Читайте также:  Linux раздача интернета wifi

Свойства «clip2net.bin»_018

Закрываем окно. И перетаскиваем этот файл в терминал, запущенный от суперпользователя, имя файла и путь уже впишутся автоматически, остается лишь нажать на кнопку «Enter». Далее, вы можете установить bin файл, как и в первом варианте. На этом все.

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

How can I install a .bin file?

I want to update Acrobat Reader for Firefox, but the download has the .bin extension. How can I install it?

You should always try to install software from repositories (that is using synaptic/software center) to get security updates, new release,etc much more easily. Please note that you won’t get support (from launchpad.net, ubuntuforums.org or other Ubuntu support channels) for applications that aren’t installed from official sources.

8 Answers 8

Go into a terminal and issue the following command in the directory where the bin file is,

If you get a permission error and/or you’re dealing with an installer that applies system-wide changes you might have to launch your application with root privileges:

Hi, I am very illiterate in terminal. I have the bin file in desktop. Please tell me how to execute it. thanks

In terminal type cd Desktop and press enter.And then type chmod a+x name_of_file.bin and press enter.Finally type sudo ./name_of_file.bin It will install the bin file.

if you wanted to do this without the terminal you can flip executable bit with right click properties -> permissions -> set executable bit. but run as I don’t know how to do without a terminal

Right click and select properties then go to permissions tab and tick allow excecuting.

enter image description here

Now double click the file and select run.

Some binaries require to be run from a terminal. If that’s the case with your .bin file and/or nothing happens after double-clicking, drag the file into a new terminal window and run it by pressing ‘Return’. The output should give you a clue on what’s wrong.

So! 1. I changed the «allow exectuing » from properties. 2. used chmod to change permission, currently the permission is -rwxr-xr-x- 3. then i executed using .?filename.bin there is no response after that! what should i do?

If you want to globally install any binary, use the install command.

sudo install ./mybin /usr/bin/ 

The install command is used to copy files, and it does so by combining several commands into one to make them easy to use, i.e. cp , chown , chmod , and strip .

I want to update the Acrobat reader for firefox.

Adobe Reader is available in the Software Center.

Important note: This is only relevant for packages that don’t have a 64-bit version (e.g. Acrobat Reader). Installing ia32-libs is not required if you can download a 64-bit executable and/or are running a 32-bit system in the first place.

If your 64-bit Ubuntu doesn’t have the following package installed , you will not able to access Acrobat Reader.

sudo apt-get install ia32-libs chmod a+x yourfile.bin sudo ./yourfile.bin 

Источник

Оцените статью
Adblock
detector