Ubuntu(16.04.2)學習筆記(一)如何解決dpkg: error processing install-info


一、服務器安裝軟件是出現以下的錯誤信息:

www@TinywanAliYun:~$ sudo apt-get install letsencrypt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
letsencrypt is already the newest version (0.17.0-2+ubuntu16.04.1+certbot+1).
0 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up php7.0-mysql (7.0.22-0ubuntu0.16.04.1) ...
dpkg: error processing package php7.0-mysql (--configure):
 subprocess installed post-installation script returned error exit status 10
Errors were encountered while processing:
 php7.0-mysql
E: Sub-process /usr/bin/dpkg returned an error code (1)

二、具體步驟

1、將info文件夾更名

命令如下:www@TinywanAliYun:~# mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/

2、再新建一個新的info文件夾 

命令如下:www@TinywanAliYun:~# mkdir /var/lib/dpkg/info/

3、更新文件列表:apt-get update

命令如下:www@TinywanAliYun:~# apt-get update

信息如下:       

www@TinywanAliYun:~$ sudo apt update
[sudo] password for www: 
Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease
Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease                                                                 
Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease                                                                
Hit:4 http://ppa.launchpad.net/certbot/certbot/ubuntu xenial InRelease 

4、重新安裝 

命令如下:www@TinywanAliYun:~# apt-get -f install

信息如下:

www@TinywanAliYun:~$ sudo  apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up php7.0-mysql (7.0.22-0ubuntu0.16.04.1) ...

5、執行完上一步操作后會在新的info文件夾下生成一些文件,現將這些文件全部移到info_old文件夾下 

命令如下:www@TinywanAliYunu:~# mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/

6、把自己新建的info文件夾刪掉 

命令如下:www@TinywanAliYun:~# rm -rf /var/lib/dpkg/info

7、把info_old文件夾重新改回info 

命令如下:www@TinywanAliYun:~# mv /var/lib/dpkg/info_old/ /var/lib/dpkg/info/

8、輸入上述命令之后

 在執行 sudo apt-get update 就不會有問題了

9、繼續到第一步的安裝信息

www@TinywanAliYun:~$ sudo apt-get install letsencrypt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
letsencrypt is already the newest version (0.17.0-2+ubuntu16.04.1+certbot+1).
0 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.

 10、安裝結束


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM