linux系统pcre是什么作用,Linux下PCRE的安装与卸载
系統基于ubuntu server 14.04.4 amd64,即Ubuntu系統的服務器版本,基本適用于桌面版
安裝
第一步 到PCRE官網下載PCRE的壓縮包,并解壓
PCRE官網首頁找到下載頁面鏈接:
這里我們選擇PCRE1的最新版(8.39),右鍵復制鏈接地址:
在Linux中使用wget命令下載,執行如下命令開始下載:
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
解壓:
tar zxvf pcre-8.39.tar.gz
第二步 進行安裝
進入PCRE的解壓目錄,開始安裝,安裝過程比較簡單,依次執行下面幾條命令即可:
配置:
./configure
注意:
(1) 如果之前沒有安裝C compiler(C 編譯器),這一步將報如下錯誤信息:
configure: error: in `/home/xueliang/download/pcre-8.39’:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details
xueliang@dev:~/download/pcre-8.39$
可以參考這篇文章安裝C compiler,然后繼續下面的操作
(2) 如果之前沒有安裝C++ compiler(C++ 編譯器),這一步將報如下錯誤信息:
configure: error: You need a C++ compiler for C++ support.
xueliang@dev:~/download/pcre-8.39$
可以參考這篇文章安裝C++ compiler,然后繼續下面的操作
編譯:
make
如果之前沒有安裝make命令,這一步將報如下錯誤信息:
xueliang@dev:~/download$ make
The program ‘make’ is currently not installed. You can install it by typing:
sudo apt-get install make
xueliang@dev:~/download$
可以參考這篇文章安裝make命令,然后繼續下面的操作
對編譯結果進行測試:
make test
如果編譯無誤,會得到如下信息:
Testsuite summary for PCRE 8.39
============================================================================
# TOTAL: 5
# PASS: 5
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
如果通過測試,就可以開始安裝了,執行如下命令完成PCRE的安裝:
sudo make install
卸載
在PCRE的解壓目錄下,一條命令搞定:
sudo make uninstall
完成卸載:
xueliang@dev:~/download/pcre-8.39$ sudo make uninstall
[sudo] password for xueliang:
( cd ‘/usr/local/bin’ && rm -f pcretest pcregrep )
( cd ‘/usr/local/bin’ && rm -f pcre-config )
( cd ‘/usr/local/share/doc/pcre’ && rm -f pcre.txt pcre-config.txt pcregrep.txt pcretest.txt AUTHORS COPYING ChangeLog LICENCE NEWS README )
( cd ‘/usr/local/share/doc/pcre/html’ && rm -f NON-AUTOTOOLS-BUILD.txt README.txt index.html pcre-config.html pcre.html pcre16.html pcre32.html pcre_assign_jit_stack.html pcre_compile.html pcre_compile2.html pcre_config.html pcre_copy_named_substring.html pcre_copy_substring.html pcre_dfa_exec.html pcre_exec.html pcre_free_study.html pcre_free_substring.html pcre_free_substring_list.html pcre_fullinfo.html pcre_get_named_substring.html pcre_get_stringnumber.html pcre_get_stringtable_entries.html pcre_get_substring.html pcre_get_substring_list.html pcre_jit_exec.html pcre_jit_stack_alloc.html pcre_jit_stack_free.html pcre_maketables.html pcre_pattern_to_host_byte_order.html pcre_refcount.html pcre_study.html pcre_utf16_to_host_byte_order.html pcre_utf32_to_host_byte_order.html pcre_version.html pcreapi.html pcrebuild.html pcrecallout.html pcrecompat.html pcredemo.html pcregrep.html pcrejit.html pcrelimits.html pcrematching.html pcrepartial.html pcrepattern.html pcreperform.html pcreposix.html pcreprecompile.html pcresample.html pcrestack.html pcresyntax.html pcretest.html pcreunicode.html )
( cd ‘/usr/local/share/doc/pcre/html’ && rm -f pcrecpp.html )
( cd ‘/usr/local/include’ && rm -f pcreposix.h pcrecpp.h pcre_scanner.h )
/bin/bash ./libtool –mode=uninstall rm -f ‘/usr/local/lib/libpcre.la’
libtool: uninstall: rm -f /usr/local/lib/libpcre.la /usr/local/lib/libpcre.so.1.2.7 /usr/local/lib/libpcre.so.1 /usr/local/lib/libpcre.so /usr/local/lib/libpcre.a
/bin/bash ./libtool –mode=uninstall rm -f ‘/usr/local/lib/libpcreposix.la’
libtool: uninstall: rm -f /usr/local/lib/libpcreposix.la /usr/local/lib/libpcreposix.so.0.0.4 /usr/local/lib/libpcreposix.so.0 /usr/local/lib/libpcreposix.so /usr/local/lib/libpcreposix.a
/bin/bash ./libtool –mode=uninstall rm -f ‘/usr/local/lib/libpcrecpp.la’
libtool: uninstall: rm -f /usr/local/lib/libpcrecpp.la /usr/local/lib/libpcrecpp.so.0.0.1 /usr/local/lib/libpcrecpp.so.0 /usr/local/lib/libpcrecpp.so /usr/local/lib/libpcrecpp.a
( cd ‘/usr/local/share/man/man1’ && rm -f pcre-config.1 pcregrep.1 pcretest.1 )
( cd ‘/usr/local/share/man/man3’ && rm -f pcre.3 pcre16.3 pcre32.3 pcre_assign_jit_stack.3 pcre_compile.3 pcre_compile2.3 pcre_config.3 pcre_copy_named_substring.3 pcre_copy_substring.3 pcre_dfa_exec.3 pcre_exec.3 pcre_free_study.3 pcre_free_substring.3 pcre_free_substring_list.3 pcre_fullinfo.3 pcre_get_named_substring.3 pcre_get_stringnumber.3 pcre_get_stringtable_entries.3 pcre_get_substring.3 pcre_get_substring_list.3 pcre_jit_exec.3 pcre_jit_stack_alloc.3 pcre_jit_stack_free.3 pcre_maketables.3 pcre_pattern_to_host_byte_order.3 pcre_refcount.3 pcre_study.3 pcre_utf16_to_host_byte_order.3 pcre_utf32_to_host_byte_order.3 pcre_version.3 pcreapi.3 pcrebuild.3 pcrecallout.3 pcrecompat.3 pcredemo.3 pcrejit.3 pcrelimits.3 pcrematching.3 pcrepartial.3 pcrepattern.3 pcreperform.3 pcreposix.3 pcreprecompile.3 pcresample.3 pcrestack.3 pcresyntax.3 pcreunicode.3 pcrecpp.3 )
( cd ‘/usr/local/include’ && rm -f pcre.h pcrecpparg.h pcre_stringpiece.h )
( cd ‘/usr/local/lib/pkgconfig’ && rm -f libpcre.pc libpcreposix.pc libpcrecpp.pc )
xueliang@dev:~/download/pcre-8.39$
總結
以上是生活随笔為你收集整理的linux系统pcre是什么作用,Linux下PCRE的安装与卸载的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C# - Tester-Doer Pat
- 下一篇: 赖美云的认证照_创造101赖美云早年照片