Ubuntu(16.04.2)学习笔记(一)如何解决dpkg: error processing install-info

本文介绍了解决在Ubuntu 16.04服务器上安装letsencrypt时遇到的PHP 7.0 MySQL配置错误的方法。通过重命名并重建dpkg 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、安装结束

aac414@DESKTOP-AORSPFA:~$ wsl --shutdown Command 'wsl' not found, but can be installed with: sudo apt install wsl aac414@DESKTOP-AORSPFA:~$ wsl Command 'wsl' not found, but can be installed with: sudo apt install wsl aac414@DESKTOP-AORSPFA:~$ sudo dpkg --configure -a [sudo] password for aac414: Setting up systemd (255.4-1ubuntu8.10) ... Failed to take /etc/passwd lock: Invalid argument dpkg: error processing package systemd (--configure): installed systemd package post-installation script subprocess returned error exit status 1 dpkg: dependency problems prevent configuration of systemd-timesyncd: systemd-timesyncd depends on systemd; however: Package systemd is not configured yet. dpkg: error processing package systemd-timesyncd (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of udev: udev depends on systemd | systemd-standalone-sysusers | systemd-sysusers; however: Package systemd is not configured yet. Package systemd-standalone-sysusers is not installed. Package systemd-sysusers is not installed. Package systemd which provides systemd-sysusers is not configured yet. dpkg: error processing package udev (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libpam-systemd:amd64: libpam-systemd:amd64 depends on systemd (= 255.4-1ubuntu8.10); however: Package systemd is not configured yet. dpkg: error processing package libpam-systemd:amd64 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of systemd-resolved: systemd-resolved depends on systemd (= 255.4-1ubuntu8.10); however: Package systemd is not configured yet. dpkg: error processing package systemd-resolved (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libnss-systemd:amd64: libnss-systemd:amd64 depends on systemd (= 255.4-1ubuntu8.10); however: Package systemd is not configured yet. dpkg: error processing package libnss-systemd:amd64 (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: systemd systemd-timesyncd udev libpam-systemd:amd64 systemd-resolved libnss-systemd:amd64 aac414@DESKTOP-AORSPFA:~$
最新发布
09-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值