热门标签 | HotTags
当前位置:  开发笔记 > 前端 > 正文

Ubuntu下安装OpenSC

1.卸载系统中原有的OpenSC:$sudoapt-getremovelibopensc2$sudoapt-getremovelibopenct12.安装OpenSC依赖的软件包:$sudoapt-getinstallbuild-essential$sudoapt-getinstalllibssl

1.卸载系统中原有的 OpenSC :
  $ sudo apt-get remove libopensc2
  $ sudo apt-get remove libopenct1

2.安装 OpenSC 依赖的软件包:
  $ sudo apt-get install build-essential
  $ sudo apt-get install libssl-dev
  $ sudo apt-get install libpcsclite-dev
  $ sudo apt-get install pcscd
  $ sudo apt-get install automake
  $ sudo apt-get install autoconf
  $ sudo apt-get install autogen
  $ sudo apt-get install libtool

注:如果 pcscd 安装失败,则采用源码安装:
  1)卸载已安装的 pcsclite :
    $ sudo apt-get remove libpcsclite-dev
  2)从 http://pcsclite.alioth.debian.org/ 下载 pcsclite-版本号.tar.bz2 源代码包;
  3)安装 pcsclite :
    $ tar xf pcsclite-版本号.tar.bz2
    $ cd pcsc-lite-版本号
    $ ./configure
    注:出现错误提示:configure: error: install libhal-dev or use –disable-libhal
      首先选择安装:$ sudo apt-get install libhal-dev
    $ make
    $ sudo make install

3.从 http://www.opensc-project.org/opensc 下载最新版本的 opensc-版本号.tar.gz;
4.安装 OpenSC :
  $ ./bootstrap
  $ ./configure --enable-openssl --enable-pcsc
  注:出现错误提示:configure: error: xsl-stylesheets are required for svn build with man
    添加–disable-man选项:$ ./configure --enable-openssl --enable-pcsc --disable-man
  $ make
  $ sudo make install

5.运行 opensc-tool 或 pkcs15-init 工具,
  1)出现如下类似错误:
    error while loading shared libraries:
    libpkcs15init.so.2: cannot open shared object file: No such file or directory
    重新加载一下动态连接库的索引:$ sudo ldconfig

  2)出现如下类似错误:
    No smart card readers found
    尝试启动pcscd服务(带输出信息):$ /usr/local/sbin/pcscd -a -d -f

  3)出现如下类似错误:
    00001001 hotplug_libhal.c:527:HPRegisterForHotplugEvents()
    No bundle files in pcsc drivers directory: /usr/local/pcsc/drivers
    安装 ccid 驱动:
    1>从 http://pcsclite.alioth.debian.org/ 下载 ccid-版本号.tar.bz2 源代码包
    2>$ tar xf ccid-版本号.tar.bz2
    3>$ cd ccid-版本号
    4>$ ./configure
      注:出现错误提示:
        configure: error: usb.h not found, install libusb or
        use ./configure LIBUSB_CFLAGS=…
        安装 libusb-dev :$ sudo apt-get install libusb-dev
    5>$ make
    6>$ sudo make install
    尝试启动pcscd服务(带输出信息):$ /usr/local/sbin/pcscd -a -d -f
    成功启动,按Ctrl+C终止进程,这次从后台启动:$ /usr/local/sbin/pcscd -a -d


推荐阅读
author-avatar
荧光绿的包包
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有