- デフォルトシェルをzshにした
- gitをインストール
- vimをインストール
- rcの最小限の設定した
- pyenvのインストールして、ためしにPython2.6.6環境なディレクトリつくる
http://qiita.com/la_luna_azul/items/3f64016feaad1722805c
www15224uf% cd ~
www15224uf% git clone git://github.com/yyuu/pyenv.git .pyenv
www15224uf% echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.zshrc
www15224uf% echo 'if [ -d "${PYENV_ROOT}" ]; then' >> ~/.zshrc
www15224uf% echo ' export PATH=${PYENV_ROOT}/bin:$PATH' >> ~/.zshrc
www15224uf% echo ' eval "$(pyenv init -)"' >> ~/.zshrc
www15224uf% echo 'fi' >> ~/.zshrc
www15224uf% exec $SHELL -l
www15224uf% cd $PYENV_ROOT/plugins
www15224uf% git clone git://github.com/yyuu/pyenv-virtualenv.git
www15224uf% pyenv --version
pyenv 0.4.0-20130726-32-gc95d446www15224uf% pyenv install 2.6.6
ERROR: This package must be compiled with gcc, but python-build couldn't
find a suitable `gcc` executable on your system. Please install gcc
and try again.
BUILD FAILED
www15224uf%www15224uf% sudo apt-get install gcc
[sudo] password for otiai10:
Reading package lists... Done
...略...
www15224uf% gcc --version
gcc (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
www15224uf%www15224uf% pyenv install 2.6.6
Downloading Python-2.6.6.tgz...
-> http://yyuu.github.io/pythons/b2f209df270a33315e62c1ffac1937f0
Installing Python-2.6.6...
BUILD FAILED
Inspect or clean up the working tree at /tmp/python-build.20131001131900.9257
Results logged to /tmp/python-build.20131001131900.9257.log
Last 10 log lines:
checking for socklen_t... yes
checking for build directories... done
configure: creating ./config.status
config.status: creating Makefile.pre
config.status: creating Modules/Setup.config
config.status: creating pyconfig.h
creating Modules/Setup
creating Modules/Setup.local
creating Makefile
/home/otiai10/.pyenv/plugins/python-build/bin/python-build: line 550: make: command not foundmakeコマンドが無い...
www15224uf% sudo apt-get install make
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
make-doc
The following NEW packages will be installed:
make
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 396 kB of archives.
After this operation, 1,172 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main make amd64 3.81-8.2 [396 kB]
Fetched 396 kB in 0s (701 kB/s)
Selecting previously unselected package make.
(Reading database ... 31556 files and directories currently installed.)
Unpacking make (from .../make_3.81-8.2_amd64.deb) ...
Processing triggers for man-db ...
Setting up make (3.81-8.2) ...
www15224uf% make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
www15224uf%www15224uf% pyenv install 2.6.6
Downloading Python-2.6.6.tgz...
-> http://yyuu.github.io/pythons/b2f209df270a33315e62c1ffac1937f0
Installing Python-2.6.6...
BUILD FAILED
Inspect or clean up the working tree at /tmp/python-build.20131001132512.15098
Results logged to /tmp/python-build.20131001132512.15098.log
Last 10 log lines:
(cd /home/otiai10/.pyenv/versions/2.6.6/bin; ln python2.6 python)
rm -f /home/otiai10/.pyenv/versions/2.6.6/bin/python-config
(cd /home/otiai10/.pyenv/versions/2.6.6/bin; ln -s python2.6-config python-config)
Creating directory /home/otiai10/.pyenv/versions/2.6.6/share/man
Creating directory /home/otiai10/.pyenv/versions/2.6.6/share/man/man1
/usr/bin/install -c -m 644 ./Misc/python.man \
/home/otiai10/.pyenv/versions/2.6.6/share/man/man1/python.1
Traceback (most recent call last):
File "<string>", line 4, in <module>
ImportError: The Python readline extension was not compiled. Missing the GNU readline lib?readlineが無い...
Missing the GNU readline libでググった。で、これ http://www.bioinf.org.uk/software/profit/doc/node17.html
www15224uf% apt-cache search libreadline
cupt - alternative front-end for dpkg -- console interface
libreadline-java - GNU readline and BSD editline wrappers for Java
libreadline-java-doc - API docs for readline/editline wrappers for Java
libreadline-gplv2-dev - GNU readline and history libraries, development files
libreadline5 - GNU readline and history libraries, run-time libraries
libreadline5-dbg - GNU readline and history libraries, debugging libraries
libreadline-dev - GNU readline and history libraries, development files
libreadline6 - GNU readline and history libraries, run-time libraries
libreadline6-dbg - GNU readline and history libraries, debugging libraries
libreadline6-dev - GNU readline and history libraries, development files
libruby - Libraries necessary to run Ruby
libruby1.8 - Libraries necessary to run Ruby 1.8
libruby1.9.1 - Libraries necessary to run Ruby 1.9.1
www15224uf%ここで天の声が CV @kazz187
dev がついてる奴がないとコンパイルできない。dev の中身は何かって言うと、 install している library の .h とかのヘッダーファイルが入ってる。 コンパイルするときに include するんだけど、そのファイルが無いともちろんエラーになる。 dev を入れると依存関係で dev ついてない無印がたいてい入る
www15224uf% sudo apt-get install libreadline6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libtinfo-dev
The following NEW packages will be installed:
libreadline6-dev libtinfo-dev
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 297 kB of archives.
After this operation, 1,143 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main libtinfo-dev amd64 5.9-10 [105 kB]
Get:2 http://ftp.jp.debian.org/debian/ wheezy/main libreadline6-dev amd64 6.2+dfsg-0.1 [193 kB]
Fetched 297 kB in 0s (358 kB/s)
Selecting previously unselected package libtinfo-dev:amd64.
(Reading database ... 31590 files and directories currently installed.)
Unpacking libtinfo-dev:amd64 (from .../libtinfo-dev_5.9-10_amd64.deb) ...
Selecting previously unselected package libreadline6-dev:amd64.
Unpacking libreadline6-dev:amd64 (from .../libreadline6-dev_6.2+dfsg-0.1_amd64.deb) ...
Setting up libtinfo-dev:amd64 (5.9-10) ...
Setting up libreadline6-dev:amd64 (6.2+dfsg-0.1) ...
www15224uf%無印っぽいので、sudo apt-get install libreadline6-devもした
以下φ(`д´)メモメモ...
www15224uf% sudo apt-get install libbz2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libbz2-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 32.8 kB of archives.
After this operation, 84.0 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main libbz2-dev amd64 1.0.6-4 [32.8 kB]
Fetched 32.8 kB in 0s (66.7 kB/s)
Selecting previously unselected package libbz2-dev:amd64.
(Reading database ... 31628 files and directories currently installed.)
Unpacking libbz2-dev:amd64 (from .../libbz2-dev_1.0.6-4_amd64.deb) ...
Setting up libbz2-dev:amd64 (1.0.6-4) ...
なんか色々叱られる
- libreadline-dev
- zlib-dev
- libbz2-dev
- libsqlite3-dev
- libssl-dev
できた
おわり
~/.vimrc
" color
syntax on
" tab
set tabstop=4
set expandtab~/.zshrc
##### alias
alias vi='vim'おわり
www15224uf% vim
zsh: command not found: vim
www15224uf% sudo apt-get install vim
Reading package lists... Done
...以下略...
www15224uf% which vim
/usr/bin/vim
www15224uf% vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 10 2013 02:28:47)おわり
www15224uf% sudo apt-get install git
[sudo] password for otiai10:
Reading package lists... Done
...以下略...
www15224uf% which git
/usr/bin/git
www15224uf%おわり
otiai10@www15224uf:~$ apt-cache search zsh
...略...
zsh - shell with lots of features
...略...
otiai10@www15224uf:~$ sudo apt-get install zsh
-bash: sudo: command not found
otiai10@www15224uf:~$ apt-get install zsh
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?otiai10@www15224uf:~$ apt-get install sudo
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
otiai10@www15224uf:~$ su -
Password:
root@www15224uf:~# apt-get install sudo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
sudo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 842 kB of archives.
After this operation, 1,882 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main sudo amd64 1.8.5p2-1+nmu1 [842 kB]
Fetched 842 kB in 0s (916 kB/s)
Selecting previously unselected package sudo.
(Reading database ... 24559 files and directories currently installed.)
Unpacking sudo (from .../sudo_1.8.5p2-1+nmu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up sudo (1.8.5p2-1+nmu1) ...
root@www15224uf:~# which sudo
/usr/bin/sudo
root@www15224uf:~# exit
logout
otiai10@www15224uf:~$ which sudo
/usr/bin/sudo
otiai10@www15224uf:~$ sudo apt-get install zsh
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for otiai10:
otiai10 is not in the sudoers file. This incident will be reported.
```
## `sudoer`に追加する(EDITORがnanoなのでviにした)
```sh
otiai10@www15224uf:~$ su -
Password:
root@www15224uf:~# visudo
# nanoなので画面殴るかと思った
root@www15224uf:~# vi .bashrc
# export EDITOR='vi'
root@www15224uf:~# source .bashrc
root@www15224uf:~# visudo
# otiai10をsudoerに追加
root@www15224uf:~# exit
logout
otiai10@www15224uf:~$ pwd
/home/otiai10
otiai10@www15224uf:~$ sudo ls
[sudo] password for otiai10:
otiai10@www15224uf:~$
```
## `zsh`をインストールしてデフォルトシェルに設定する
```sh
otiai10@www15224uf:~$ sudo apt-get install zsh
...略...
otiai10@www15224uf:~$ zsh
This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~). This function can help you with a few settings that should
make your use of the shell easier.
You can:
(q) Quit and do nothing. The function will be run again next time.
(0) Exit, creating the file ~/.zshrc containing just a comment.
That will prevent this function being run again.
(1) Continue to the main menu.
(2) Populate your ~/.zshrc with the configuration recommended
by the system administrator and exit (you will need to edit
the file by hand, if so desired).
--- Type one of the keys in parentheses ---
Aborting.
The function will be run again next time. To prevent this, execute:
touch ~/.zshrc
www15224uf%
www15224uf% exit
otiai10@www15224uf:~$
otiai10@www15224uf:~$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/bin/zsh
/usr/bin/zsh
otiai10@www15224uf:~$ chsh -s zsh
Password:
chsh: zsh is an invalid shell
otiai10@www15224uf:~$ which zsh
/usr/bin/zsh
otiai10@www15224uf:~$ chsh -s /usr/bin/zsh
Password:
otiai10@www15224uf:~$ exit
logout
```
で、再びsshログインすると
```sh
www15224uf%
www15224uf% echo $SHELL
/usr/bin/zsh
www15224uf%
```
おわり
http://stackoverflow.com/questions/6169522/no-module-named-zlib
http://stackoverflow.com/questions/6169522/no-module-named-zlib