※ Ubuntu에서 YARA를 설치하는 과정을 기록합니다.
[ 참고 사이트 ]
전체 설치 과정 :
http://pinowudi.blogspot.com/2010/09/installing-yara-on-ubuntu-1004.html
Error 처리 관련 :
http://yara-project.googlecode.com/svn-history/r41/trunk/yara-python/README
http://www.singhvishwajeet.com/2009/09/16/solving-the-build-error-python-h-no-such-file-or-directory-on-ubuntu/
전제 : Python이 설치되어 있는 환경에서 진행합니다.
( 기본적으로 Ubuntu에서는 Python을 기본 설치되어 있는 상태이다. )
Step 0. 사전 설치 환경 꾸리기
=== 피클 Library Package 설치 ===
$ sudo apt-get install libpcre3 libpcre3-dev
=== g++ Compiler 설치 ===
$ sudo apt-get install build-essential
$ sudo apt-get install g++
- 위의 두개의 Command를 통해 설치해도 되지만 g++의 경우 Ubuntu에서 Ubuntu Software에서 찾아 설치가
가능하다. 이점 참고 바란다.
Step 1. YARA 다운
- URL :
http://code.google.com/p/yara-project/downloads/list
$ wget http://yara-project.googlecode.com/files/yara-1.6.tar.gz
$ wget http://yara-project.googlecode.com/files/yara-python-1.6.tar.gz
Step 2. YARA 설치
$ tar xvfz yara-1.6.tar.gz
$ cd yara-1.6.tar.gz
$ ./configure
$ make
$ make check
$ sudo make install
Step 3. YARA-Python 설치
$ cd ..
$ tar xvfz yara-python-1.6.tar.gz
$ cd yara-python-1.6.tar.gz
$ python setup.py build
$ sudo python setup.py install
[ Error Report ]
yara-python.c:19:20: fatal error: Python.h: No such file or directory
$ sudo apt-cache search python
$ sudo apt-get install python2.7-dev
ImportError: libyara.so.0: cannot open shared object file: No such file or directory
$ sudo echo "/usr/local/lib" >> /etc/ld.so.conf
$ sudo ldconfig
- 첫번째 Line의 명령이 /etc 폴터의 권한 문제로 정상 동작하지 않은 경우가 있었지만 두번째 Line의 명령어를
실행해도 위의 문제는 해결되었다.