【ubuntu】手把手教你解决ubuntu报错openssh-server E: Sub-process /usr/bin/dpkg returned an error code (1)

简介: 【ubuntu】手把手教你解决ubuntu报错openssh-server E: Sub-process /usr/bin/dpkg returned an error code (1)


👉博__主👈:米码收割机

👉技__能👈:C++/Python语言

👉公众号👈:测试开发自动化【获取源码+商业合作】

👉荣__誉👈:阿里云博客专家博主、51CTO技术博主

👉专__注👈:专注主流机器人、人工智能等相关领域的开发、测试技术。



1. ubuntu安装软件报错

(这报错真TM烦人)

Setting up openssh-server (1:8.2p1-4ubuntu0.9) …

dpkg: error processing package openssh-server (–configure):

installed openssh-server package post-installation script subprocess returned error exit status 10

Setting up ufw (0.36-6ubuntu1.1) …

dpkg: error processing package ufw (–configure):

installed ufw package post-installation script subprocess returned error exit status 10

Errors were encountered while processing:

openssh-server
ufw

E: Sub-process /usr/bin/dpkg returned an error code (1)


2. 解决办法

第一步:现将info文件夹更名

sudo mv /var/lib/dpkg/info  /var/lib/dpkg/info.bak

第二步:备份到其他地方(这步可省略)

sudo cp -rf /var/lib/dpkg/info.bak/* /home/bak/info_bak/

第三步:再新建一个新的 info文 件

sudo mkdir /var/lib/dpkg/info

第四步:更新源

sudo apt-get update

第五步:重新安装有问题的依赖包(不知道的话,可以都执行一遍)

sudo apt-get -f install openssh-server
sudo apt-get -f install ssh
sudo apt-get -f install exim4-base
sudo apt-get -f install exim4-daemon-light
sudo apt-get -f install exim4

第六步:调整安装依赖后,把新的东西移动到备份文件夹 info.bak 里

sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info.bak

第七步:把自己新建的 info 文件夹删掉

sudo rm -rf /var/lib/dpkg/info

第八步:把备份的 info 文件夹重新改回名字

sudo mv /var/lib/dpkg/info.bak /var/lib/dpkg/info


相关文章
|
Ubuntu
ubuntu报错:OpenSSL is not properly installed on your system.
ubuntu报错:OpenSSL is not properly installed on your system.
195 0
|
7月前
|
人工智能 Ubuntu 机器人
【ubuntu】手把手教你解决ubuntu报错openssh-server E: Sub-process /usr/bin/dpkg returned an error code (1)
【ubuntu】手把手教你解决ubuntu报错openssh-server E: Sub-process /usr/bin/dpkg returned an error code (1)
770 0
|
6月前
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
108 1
|
Shell Linux
Linux pip命令报错 -bash: pip: command not found
Linux pip命令报错 -bash: pip: command not found
366 0
|
Linux Shell
Linux报错:pip: command not found
Linux报错:pip: command not found
215 0
|
Ubuntu 网络协议 Linux
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
2396 0
Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.
|
Shell Linux
CentOS7下-bash: nano: command not found
由于安装的是纯净版系统,运行nano命令是提示没有找到该命令,以下是解决方法,用root权限的用户运行以下命令安装nano: yum install nano 遇到询问时一路点y即可。 安装好后运行:nano a.txt,如果该文件不存在就会创建一个。
4455 0