【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


相关文章
|
6月前
|
Ubuntu
ubuntu报错:OpenSSL is not properly installed on your system.
ubuntu报错:OpenSSL is not properly installed on your system.
108 0
|
5月前
|
Ubuntu 计算机视觉 C++
Ubuntu 20.04 编译 Opencv 4.11,详细步骤(带图)及报错解决,我的踩坑之旅~
Ubuntu 20.04 编译 Opencv 4.11,详细步骤(带图)及报错解决,我的踩坑之旅~
652 0
|
29天前
|
人工智能 缓存 Ubuntu
【Ubuntu】Ubuntu安装PCL(安装PCL/卸载PCL/查看PCL版本/PCL报错处理相关操作)(史上最详细)
【Ubuntu】Ubuntu安装PCL(安装PCL/卸载PCL/查看PCL版本/PCL报错处理相关操作)(史上最详细)
|
6月前
|
存储 缓存 NoSQL
如何解决Ubuntu server 下 Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”.
如何解决Ubuntu server 下 Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”.
150 0
|
5月前
|
Ubuntu Linux 开发工具
Linux操作系统Ubuntu 22.04配置Visual Studio Code与C++代码开发环境的方法
Linux操作系统Ubuntu 22.04配置Visual Studio Code与C++代码开发环境的方法
129 1
|
9天前
|
Ubuntu Linux Python
Linux(15)Ubuntu安装ninja构建工具
Linux(15)Ubuntu安装ninja构建工具
27 0
|
2天前
|
Ubuntu Shell 网络安全
【专栏】如何在 Ubuntu 22.04 上安装 KubeSphere?
【4月更文挑战第28天】在Ubuntu 22.04上安装KubeSphere的指南:确保系统至少有4GB内存和2核CPU,安装Docker和docker-compose。下载安装脚本`curl -sSL https://kubesphere.io/install.sh | bash`,根据提示选择安装选项,等待完成。安装后,通过访问控制台验证安装效果。解决可能出现的错误、网络问题和性能问题,利用KubeSphere提升容器管理效率。本文为顺利安装和使用提供参考。
|
7天前
|
人工智能 Ubuntu Shell
【Ubuntu工具】安装教程:Ubuntu系统上源码编译安装QT5.15.13(有坑)
【Ubuntu工具】安装教程:Ubuntu系统上源码编译安装QT5.15.13(有坑)
26 0
|
7天前
|
人工智能 Ubuntu C语言
【Ubuntu工具】详细图文教程:Ubuntu系统上安装QT6.2
【Ubuntu工具】详细图文教程:Ubuntu系统上安装QT6.2
16 0
|
7天前
|
人工智能 Ubuntu
【Ubuntu工具】踩坑记录:Ubuntu18.04安装FlameShot截图工具及使用方法
【Ubuntu工具】踩坑记录:Ubuntu18.04安装FlameShot截图工具及使用方法
20 0