无法安装 openssh-server 的新状态: 没有那个文件或目录 E: Sub-process /usr/bin/dpkg returned an error code (2)
时间: 2023-10-23 21:10:03 浏览: 160
ubuntu安装openssh-server
根据引用和引用的指引,你可以尝试以下步骤解决无法安装openssh-server的问题:
1. 首先,运行以下命令备份当前的info文件夹:
```
sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bk
```
2. 接着,创建一个新的info文件夹:
```
sudo mkdir /var/lib/dpkg/info
```
3. 然后,将之前备份的文件从info.bk文件夹移动回info文件夹中:
```
sudo mv /var/lib/dpkg/info.bk/* /var/lib/dpkg/info/
```
4. 最后,尝试重新安装openssh-server:
```
sudo apt-get install openssh-server
```
这些步骤将会重新创建info文件夹并将备份的文件移回,希望能解决你的问题。如果还是没有解决,可能需要进一步的排查其他可能的原因。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [openssh-server _Ubuntu18.04远程服务离线安装包](https://download.csdn.net/download/qq_22478465/85310887)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [E: Sub-process /usr/bin/dpkg returned an error code (1)解决办法](https://blog.csdn.net/leimingxiao/article/details/126225609)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文