ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 水电费费‘ ``` ./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option. ``` 安装报错 ``` tinywan@ubuntu:$ sudo apt-get install zlib1g-dev Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-1ubuntu1.1) but 1:1.2.11.dfsg-0ubuntu2 is to be installed E: Unable to correct problems, you have held broken packages. ``` ## 解决方案: 查看以安装的zlib ``` tinywan@ubuntu:~/Downloads$ dpkg -l | grep zlib1g ii zlib1g:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 ``` 问题在于,当前系统以安装的 libc6的版本为“2.19-10ubuntu2 ” ,而我们安装其他软件(包括build-essential 、g++等)的时候,所依赖的是“2.19-0ubuntu6.9” 。 也就是问题在于, 依赖的某个软件的版本,跟系统以安装的版本不一致。但 apt-get又不会自动去卸载以安装的自动安装上依赖的目标版本。 所以导致我们需要手动去解决这个问题。  当前解决这个问题办法有很多种,我们这里选择了,直接强制覆盖安装目标版本,替代原来系统已安装的版本。 ``` ``` ### 再查看libc6的已安装信息: 再安装其他原来安装过程报类似错误的软件: ``` # apt-get install zlib1g-dev libc6-dev libc-dev libmysqlclient-dev ``` 从以上安装过程看出来,成功安装了。   我们再次执行如下命令 通过dpkg来查询具体安装信息: ``` root@ubuntu:/etc/apt# dpkg -l | grep -E "zlib1g-dev|libc6-dev|libc-dev|libmysqlclient-dev" ii  libc-dev-bin                        2.19-0ubuntu6.9                     amd64        Embedded GNU C Library: Development binaries ii  libc6-dev:amd64                     2.19-0ubuntu6.9                     amd64        Embedded GNU C Library: Development Libraries and Header Files ii  libmysqlclient-dev                  5.5.54-0ubuntu0.14.04.1             amd64        MySQL database development files ii  linux-libc-dev:amd64                3.13.0-108.155                      amd64        Linux Kernel Headers for development ii  zlib1g-dev:amd64                    1:1.2.8.dfsg-1ubuntu1               amd64        compression library - development ``` 再次确认build-essential  是否可以成功安装: ``` # dpkg -l | grep build-essential ``` 当前系统没有安装 build-essential。 ``` # dpkg -l | grep g++ ``` 当前系统没有安装 g++。 ``` # dpkg -l | grep gcc ii  gcc                                 4:4.8.2-1ubuntu6                    amd64        GNU C compiler ii  gcc-4.8                             4.8.4-2ubuntu1~14.04.3              amd64        GNU C compiler ii  gcc-4.8-base:amd64                  4.8.4-2ubuntu1~14.04.3              amd64        GCC, the GNU Compiler Collection (base package) ii  gcc-4.9-base:amd64                  4.9.1-16ubuntu6                     amd64        GCC, the GNU Compiler Collection (base package) ii  libgcc-4.8-dev:amd64                4.8.4-2ubuntu1~14.04.3              amd64        GCC support library (development files) ii  libgcc1:amd64                       1:4.9.1-16ubuntu6                   amd64        GCC support library ``` 安装 build-essential (g++也会被附带安装,所以只要安装这个基础套件,基本的编译环境就ok了):  ``` # apt-get install build-essential Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed:   g++ g++-4.8 libstdc++-4.8-dev Suggested packages:   g++-multilib g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg libstdc++-4.8-doc The following NEW packages will be installed:   build-essential g++ g++-4.8 libstdc++-4.8-dev 0 upgraded, 4 newly installed, 0 to remove and 75 not upgraded. Need to get 19.2 MB of archives. After this operation, 40.1 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security/main libstdc++-4.8-dev amd64 4.8.4-2ubuntu1~14.04.3 [1,053 kB] Get:2 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security/main g++-4.8 amd64 4.8.4-2ubuntu1~14.04.3 [18.1 MB] Get:3 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty/main g++ amd64 4:4.8.2-1ubuntu6 [1,490 B] Get:4 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B] Fetched 19.2 MB in 1s (9,947 kB/s) Selecting previously unselected package libstdc++-4.8-dev:amd64. (Reading database ... 72784 files and directories currently installed.) Preparing to unpack .../libstdc++-4.8-dev_4.8.4-2ubuntu1~14.04.3_amd64.deb ... Unpacking libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.3) ... Selecting previously unselected package g++-4.8. Preparing to unpack .../g++-4.8_4.8.4-2ubuntu1~14.04.3_amd64.deb ... Unpacking g++-4.8 (4.8.4-2ubuntu1~14.04.3) ... Selecting previously unselected package g++. Preparing to unpack .../g++_4%3a4.8.2-1ubuntu6_amd64.deb ... Unpacking g++ (4:4.8.2-1ubuntu6) ... Selecting previously unselected package build-essential. Preparing to unpack .../build-essential_11.6ubuntu6_amd64.deb ... Unpacking build-essential (11.6ubuntu6) ... Processing triggers for man-db (2.7.0.2-2) ... # ``` 安装过程成功走完,并且无任何报错提示。 检查 build-essential   和 g++是否成功安装: ``` # dpkg -l | grep -E "build-essential|g\+\+" ii  build-essential                     11.6ubuntu6                         amd64        Informational list of build-essential packages ii  g++                                 4:4.8.2-1ubuntu6                    amd64        GNU C++ compiler ii  g++-4.8                             4.8.4-2ubuntu1~14.04.3              amd64        GNU C++ compiler  ``` 确定已成功安装!!!! 最终问题解决。      这里有个深层次的原因: Ubuntu 14.10 版本在当前(2016/2017)已经从维护名单里面去除了,相应的源也不再支持,所以导致原始匹配版本的源无法使用,ping不通服务器ip。 而我这里配置的是 14.04对应的源, 其安装软件时依赖的版本是与 14.10是有差异的,所以导致 安装一些软件的时候, 依赖的软件的版本总是比当前系统已经安装的版本要低。 导致依赖冲突,最终导致安装软件无法顺利进行。 ---------------------