[Translated] Two Questions with Answers

This commit is contained in:
GOLinux 2014-11-26 09:26:27 +08:00
parent e928d55e38
commit 78d7bd287e
4 changed files with 93 additions and 96 deletions

View File

@ -1,55 +0,0 @@
Translating by GOLinux!
Linux FAQs with Answers--How to check glibc version on Linux
================================================================================
> **Question**: I need to find out the version of the GNU C library (glibc) that I have on my Linux system. How can I check glibc version on Linux?
The GNU C library (glibc) is the GNU implementation of the standard C library. glibc is a critical component of the GNU toolchain, which is used along with binutils and compiler to generate userspace application binaries for a target architecture.
When built from source, some Linux programs may be required to link against a particular version of glibc. In that case, you may want to check out the information about installed glibc to see if dependencies are met.
Here are simple ways to check glibc version on Linux.
### Method One ###
A simple command-line to check the version of the GNU C library is as follows.
$ ldd --version
![](https://farm6.staticflickr.com/5613/15631104658_940163834a_z.jpg)
In this example, the version of **glibc is 2.19**.
### Method Two ###
Another method is to "type" the **glibc library** (i.e., libc.so.6) from the command line as if it were a command.
The output will show more detailed information about **glibc library**, including the version of glibc and the GNU compiler used, as well as available glibc extensions. The location of glibc varies depending on distros and processor architectures.
On 64-bit Debian based system:
$ /lib/x86_64-linux-gnu/libc.so.6
on 32-bit Debian based system:
$ /lib/i386-linux-gnu/libc.so.6
On 64-bit Red Hat based system:
$ /lib64/libc.so.6
On 32-bit Red Hat based systems:
$ /lib/libc.so.6
Here is the sample output of typing glibc library.
![](https://farm8.staticflickr.com/7516/15631334667_ef50b247a4_z.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/check-glibc-version-linux.html
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,41 +0,0 @@
Translating by GOLinux!
Linux FAQs with Answers--How to fix “ImportError: No module named scapy.all”
================================================================================
> **Question**: When I run a Python application, I am getting "ImportError: No module named scapy.all" message. How can I fix this import error?
[Scapy][1] is a flexible packet generation and sniffer program written in Python. Using Scapy, you can create arbitrary packets, send them to the wire, reading packets from the wire or a dump file, transform packets, etc. Using Scapy's generic packet manipulation capabilities, you can easily do things like SYN scan, TCP traceroute, and OS fingerprinting. You can also integrate Scapy into another tool by importing it.
The import error indicates that you do not have Scapy installed on your Linux system. Here is how to install Scapy on Linux.
### Install Scapy on Debian, Ubuntu or Linux Mint ###
$ sudo apt-get install python-scapy
### Install Scapy on Fedora or CentOS/RHEL ###
On CentOS/RHEL, you need to [enable EPEL repository][2] first.
$ sudo yum install scapy
### Install Scapy from the Source ###
If your Linux distribution does not offer Scapy package or you want to try the latest Scapy, you can install Scapy manually from the source.
Download the [latest version of Scapy][3], and install it as follows.
$ unzip scapy-latest.zip
$ cd scapy-2.*
$ sudo python setup.py install
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/importerror-no-module-named-scapy-all.html
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.secdev.org/projects/scapy/
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[3]:http://scapy.net/

View File

@ -0,0 +1,54 @@
Linux有问必答——如何检查Linux上的glibc版本
================================================================================
> **问题**我需要找出我的Linux系统上的GNU C库glibc的版本我怎样才能检查Linux上的glibc版本呢
GNU C库glibc是标准C库的GNU实现。glibc是GNU工具链的关键组件用于和二进制工具和编译器一起使用为目标架构生成用户空间应用程序。
当从源码进行构建时一些Linux程序可能需要链接到某个特定版本的glibc。在这种情况下你可能想要检查已安装的glibc信息以查看是否满足依赖关系。
这里介绍几种简单的方法方便你检查Linux上的glibc版本。
### 方法一 ###
下面给出了命令行下检查GNU C库的简单命令。
$ ldd --version
![](https://farm6.staticflickr.com/5613/15631104658_940163834a_z.jpg)
在本例中,**glibc**版本是**2.19**。
### 方法二 ###
另一个方法是在命令行“输入”**glibc library**libc.so.6),就像命令一样。
输出结果会显示更多关于**glibc库**的详细信息包括glibc的版本以及使用的GNU编译器也提供了glibc扩展的信息。glibc变量的位置取决于Linux版本和处理器架构。
在基于Debian的64位系统上
$ /lib/x86_64-linux-gnu/libc.so.6
在基于Debian的32位系统上
$ /lib/i386-linux-gnu/libc.so.6
在基于Red Hat的64位系统上
$ /lib64/libc.so.6
在基于Red Hat的32位系统上
$ /lib/libc.so.6
下图中是输入glibc库后的输出结果样例。
![](https://farm8.staticflickr.com/7516/15631334667_ef50b247a4_z.jpg)
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/check-glibc-version-linux.html
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,39 @@
Linux有问必答——如何修复“ImportError: No module named scapy.all”
================================================================================
> **问题**当我运行一个Python应用程序时出现了这个提示消息“ImportError: No module named scapy.all”。我怎样才能修复这个导入错误呢
[Scapy][1]是一个用Python写的灵活包生成和嗅探程序。使用Scapy你可以完成创建专有包发送上线从线上或转储文件中读取包转换包等工作。使用Scapy的通用包处理能力你可以很容易地完成像SYN扫描、TCP路由跟踪以及OS指纹打印之类的工作。你也可以通过导入将Scapy整合到其它工具中。
该导入错误表明你还没有在你的Linux系统上安装Scapy。下面介绍安装方法。
### 安装Scapy到Debian, Ubuntu或Linux Mint ###
$ sudo apt-get install python-scapy
### 安装Scapy到Fedora或CentOS/RHEL ###
在CentOS/RHEL上你首先需要[启用EPEL仓库][2]。
$ sudo yum install scapy
### 源码安装Scapy ###
如果你的Linux版本没有提供Scapy包或者你想要试试最新的Scapy你可以手工使用源码包安装。
下载[最新版的Scapy][3],然后按照以下步骤安装。
$ unzip scapy-latest.zip
$ cd scapy-2.*
$ sudo python setup.py install
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/importerror-no-module-named-scapy-all.html
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.secdev.org/projects/scapy/
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
[3]:http://scapy.net/