Поиск по блогу

суббота, 7 февраля 2015 г.

Installing Node.Js and npm in kali linux - со второй попытки успешно

Поначалу попытка установить пакеты "между делом" не удалась. Здесь логи и хорошие ссылки. Есть даже скрипт установки. И есть видео от октября 2014г. Его то я и использовал. И между делом открыл полезный интерфейс apt-get install gdebi

<

Вот описание к видео, надо сранить его с моей неудачной установкой

In []:
#In this tutorial i ll show you how to install Node.js Runtime in Kali Linux
#Some important tools i used -
#GDEBI - for graphical installation(to install type "sudo apt-get install gdebi" in termial)


#Link for the Pre Compiled .deb package....
#https://dl.dropboxusercontent.com/u/9...

#If you want to generate your own .deb package(for mroe adventure), then these are the commands:-

sudo apt-get install python g++ make checkinstall fakeroot
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.ta...
tar xzvf node-latest.tar.gz && cd node-v*
./configure
sudo fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
sudo dpkg -i node_*

Пробуем выполнить установку согласно видео

In []:
root@kali:/home/kiss# apt-get install gdebi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gdebi-core gir1.2-vte-2.90
The following NEW packages will be installed:
  gdebi gdebi-core gir1.2-vte-2.90
0 upgraded, 3 newly installed, 0 to remove and 237 not upgraded.
Need to get 606 kB of archives.
After this operation, 1,860 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://http.kali.org/kali/ kali/main gdebi-core all 0.8.7 [177 kB]
Get:2 http://http.kali.org/kali/ kali/main gir1.2-vte-2.90 i386 1:0.32.2-1 [388 kB]
Get:3 http://http.kali.org/kali/ kali/main gdebi all 0.8.7 [40.9 kB]
Fetched 606 kB in 2s (211 kB/s)
Selecting previously unselected package gdebi-core.
(Reading database ... 380716 files and directories currently installed.)
Unpacking gdebi-core (from .../gdebi-core_0.8.7_all.deb) ...
Selecting previously unselected package gir1.2-vte-2.90.
Unpacking gir1.2-vte-2.90 (from .../gir1.2-vte-2.90_1%3a0.32.2-1_i386.deb) ...
Selecting previously unselected package gdebi.
Unpacking gdebi (from .../archives/gdebi_0.8.7_all.deb) ...
Processing triggers for man-db ...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Setting up gdebi-core (0.8.7) ...
Setting up gir1.2-vte-2.90 (1:0.32.2-1) ...
Setting up gdebi (0.8.7) ...
root@kali:/home/kiss# 

Теперь, если кликнуть правой кнопкой по файлу node_0.10.33-1_i386.deb (я на свой страх и риск агрузил заранее по ссылке из видео... не надо так делать... на рабочих компьютерах), то в контекстном меню появится пункт "Open with Gdebi packsge installer"

In []:
kiss@kali:~$ npm ?

Usage: npm <command>

where <command> is one of:
    add-user, adduser, apihelp, author, bin, bugs, c, cache,
    completion, config, ddp, dedupe, deprecate, docs, edit,
    explore, faq, find, find-dupes, get, help, help-search,
    home, i, info, init, install, isntall, issues, la, link,
    list, ll, ln, login, ls, outdated, owner, pack, prefix,
    prune, publish, r, rb, rebuild, remove, repo, restart, rm,
    root, run-script, s, se, search, set, show, shrinkwrap,
    star, stars, start, stop, submodule, t, tag, test, tst, un,
    uninstall, unlink, unpublish, unstar, up, update, v,
    version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm faq          commonly asked questions
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    /home/kiss/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@1.4.28 /usr/local/lib/node_modules/npm

Итак, после неудачной первой попытки, nodejs установлен. Ниже можно не читать.

Далее лог неудачной установки вот по этому рецептуInstalling Node.Js and npm in kali linux [ Debian Wheezy ]

In []:
sudo apt-get install python g++ make checkinstall fakeroot
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
sudo fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
sudo dpkg -i node_*

Ниже я пытался повторить эти команды, но на sudo fakeroot checkinstall .... выскакивает ошибка.

In []:
kiss@kali:~$ sudo apt-get install python g++ make checkinstall fakeroot
[sudo] password for kiss: 
kiss is not in the sudoers file.  This incident will be reported.
kiss@kali:~$ su
Password: 
root@kali:/home/kiss# apt-get install python g++ make checkinstall fakerootE: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
root@kali:/home/kiss# wget -N http://nodejs.org/dist/node-latest.tar.gz
--2015-02-07 14:23:43--  http://nodejs.org/dist/node-latest.tar.gz
Resolving nodejs.org (nodejs.org)... 165.225.133.150
Connecting to nodejs.org (nodejs.org)|165.225.133.150|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19096897 (18M) [application/octet-stream]
Saving to: `node-latest.tar.gz'

100%[======================================>] 19,096,897  1.63M/s   in 16s     

2015-02-07 14:23:59 (1.15 MB/s) - `node-latest.tar.gz' saved [19096897/19096897]
In []:
root@kali:/home/kiss# tar xzvf node-latest.tar.gz && cd node-v*
node-v0.12.0/
node-v0.12.0/tools/
node-v0.12.0/tools/msvs/
node-v0.12.0/tools/msvs/npm/
...
...
node-v0.12.0/doc/thin-white-stripe.jpg
node-v0.12.0/doc/changelog-head.html
node-v0.12.0/doc/node.1
node-v0.12.0/.gitattributes
In []:
root@kali:/home/kiss/node-v0.12.0# ./configure
creating  ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'clang': 0,
                 'gcc_version': 47,
                 'host_arch': 'ia32',
                 'icu_small': 'false',
                 'node_install_npm': 'true',
                 'node_prefix': '',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_v8': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_mdb': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'openssl_no_asm': 0,
                 'python': '/usr/bin/python',
                 'target_arch': 'ia32',
                 'uv_library': 'static_library',
                 'uv_parent_path': '/deps/uv/',
                 'uv_use_dtrace': 'false',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 0}}
creating  ./config.gypi
creating  ./config.mk

Итак, до сих пор все проходило неплохо, а вот далее пошли ошибки:

In []:
root@kali:/home/kiss/node-v0.12.0# fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
/usr/bin/fakeroot: line 178: checkinstall: command not found
root@kali:/home/kiss/node-v0.12.0# sudo dpkg -i node_*
dpkg: error: dpkg status database is locked by another process
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# Next
bash: Next: command not found
root@kali:/home/kiss/node-v0.12.0# Install Silverlight on Kali LInux
bash: Install: command not found
root@kali:/home/kiss/node-v0.12.0# Previous
bash: Previous: command not found
root@kali:/home/kiss/node-v0.12.0# [SOLVED] Mongodb error, “Error: couldn't connect to server 127.0.0.1 shell/mongo.js”
> Related Posts
> 
>     Install Silverlight on Kali LInuxInstall Silverlight on Kali LInux
>     05 July 2014Satish Sagi0
>     Installing KAZAM Screencaster(Screen Recorder) on Kali LinuxInstalling KAZAM Screencaster(Screen Recorder) on Kali Linux
>     25 December 2014Satish Sagi0
>     [SOLVED] Mongodb error, Error: couldn't connect to server 127.0.0.1 shell/mongo.js” [SOLVED] Mongodb error, “Error: couldn't connect to server 127.0.0.1 shell/mongo.js
>     09 May 2014Satish Sagi0
>     Install KIo-MTP in Kali LInux/Debian Wheezy [ For accessing Android devices in KDE ] Install KIo-MTP in Kali LInux/Debian Wheezy [ For accessing Android devices in KDE ]
>     14 July 2014Satish Sagi0
> 
> 4 comments:
> 
>     Victor MumboSeptember 24, 2014 at 2:42 PM
> 
>     thank you , thank you , thank you
>     Reply
>     alkzzzOctober 24, 2014 at 8:27 AM
> 
>     works like charm.. thanks!!!
>     Reply
>     BurstsOfConsistencyJanuary 19, 2015 at 8:54 AM
> 
>     Breath-taking (p)
>     Reply
>     Replies
>         BurstsOfConsistencyJanuary 19, 2015 at 9:05 AM
> 
>         ...but just crashed my Beaglebone. S'pose evything was in a temp directory so harm done. Thx again
bash: [SOLVED]: command not found
root@kali:/home/kiss/node-v0.12.0#         Reply
bash: Reply: command not found
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# :) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
bash: syntax error near unexpected token `)'
root@kali:/home/kiss/node-v0.12.0# Click to see the code!
bash: Click: command not found
root@kali:/home/kiss/node-v0.12.0# To insert emoticon you must added at least one space before the code.
bash: To: command not found
root@kali:/home/kiss/node-v0.12.0# Load more...
bash: Load: command not found
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
/usr/bin/fakeroot: line 178: checkinstall: command not found
root@kali:/home/kiss/node-v0.12.0# sudo dpkg -i node_*
dpkg: error: dpkg status database is locked by another process
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# Next
bash: Next: command not found
root@kali:/home/kiss/node-v0.12.0# Install Silverlight on Kali LInux
bash: Install: command not found
root@kali:/home/kiss/node-v0.12.0# Previous
bash: Previous: command not found
root@kali:/home/kiss/node-v0.12.0# [SOLVED] Mongodb error, “Error: couldn't connect to server 127.0.0.1 shell/mongo.js”
> Related Posts
> 
>     Install Silverlight on Kali LInuxInstall Silverlight on Kali LInux
>     05 July 2014Satish Sagi0
>     Installing KAZAM Screencaster(Screen Recorder) on Kali LinuxInstalling KAZAM Screencaster(Screen Recorder) on Kali Linux
>     25 December 2014Satish Sagi0
>     [SOLVED] Mongodb error, Error: couldn't connect to server 127.0.0.1 shell/mongo.js” [SOLVED] Mongodb error, “Error: couldn't connect to server 127.0.0.1 shell/mongo.js
>     09 May 2014Satish Sagi0
>     Install KIo-MTP in Kali LInux/Debian Wheezy [ For accessing Android devices in KDE ] Install KIo-MTP in Kali LInux/Debian Wheezy [ For accessing Android devices in KDE ]
>     14 July 2014Satish Sagi0
> 
> 4 comments:
> 
>     Victor MumboSeptember 24, 2014 at 2:42 PM
> 
>     thank you , thank you , thank you
>     Reply
>     alkzzzOctober 24, 2014 at 8:27 AM
> 
>     works like charm.. thanks!!!
>     Reply
>     BurstsOfConsistencyJanuary 19, 2015 at 8:54 AM
> 
>     Breath-taking (p)
>     Reply
>     Replies
>         BurstsOfConsistencyJanuary 19, 2015 at 9:05 AM
> 
>         ...but just crashed my Beaglebone. S'pose evything was in a temp directory so harm done. Thx again
bash: [SOLVED]: command not found
root@kali:/home/kiss/node-v0.12.0#         Reply
bash: Reply: command not found
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# :) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
bash: syntax error near unexpected token `)'
root@kali:/home/kiss/node-v0.12.0# Click to see the code!
bash: Click: command not found
root@kali:/home/kiss/node-v0.12.0# To insert emoticon you must added at least one space before the code.
bash: To: command not found
root@kali:/home/kiss/node-v0.12.0# Load more...
bash: Load: command not found
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# 
root@kali:/home/kiss/node-v0.12.0# 
In []:
 

Далее я собираюсь использовать фрагменты из скрипта binkybear / nodejs_kali_install.sh

In []:
#!/bin/bash
clear
 
if [[ $EUID -ne 0 ]]; then
echo "You must be root" 2>&1
exit 1
fi
 
ARCH=$(uname -m)
 
if [ "$ARCH" == 'x86_64' ] ; then
echo "[+] Detected AMD64"
architecture=amd64
elif [ "$ARCH" == 'i386' ] ; then
echo "[+] Detected i386"
architecture=i386
elif [ "$ARCH" == 'armv7l' ] ; then
echo "[+] Detected ARMHF"
architecture=armhf
else
echo "Unknown architecture"
exit 1
fi
sleep 5
echo ""
echo "[+] Changing to /tmp"
cd /tmp
 
# libv8 package
echo "[+] Downloading libv8 package..."
wget http://ftp.us.debian.org/debian/pool/main/libv/libv8-3.14/libv8-3.14.5_3.14.5.8-8~bpo70+1_${architecture}.deb
 
sleep 3
 
# nodejs package
echo "[+] Downloading nodejs package..."
wget http://ftp.tku.edu.tw/Linux/Kali/kali/pool/main/n/nodejs/nodejs_0.10.29~dfsg-1~bpo70+1_${architecture}.deb
 
sleep 3
 
# install nodejs / dependency
echo "[+] Installing NodeJS"
dpkg -i libv8*
dpkg -i nodejs_0.10.29~dfsg-1~bpo70+1_${architecture}.deb
ln /usr/bin/nodejs /usr/bin/node
 
echo "[+] Testing NodeJS version"
node -v
 
sleep 3
 
# install npm (you will get error but it works okay)
echo "[+] Installing NPM"
curl https://www.npmjs.org/install.sh | sudo sh
 
# clean up
echo "[+] Removing temporary files"
rm -rf /tmp/* 


Посты чуть ниже также могут вас заинтересовать

Комментариев нет:

Отправить комментарий