[SOLVED] Cannot install&upgrade with apt

Becod

Member
Feb 11, 2020
26
0
6
26
Proxmox VE version: 6.1-3
I used dpkg install pve-qemu-kvm_4.2.0-2_amd64.deb, and solved some dependency problems that apt could not solve (maybe it was broken at that time).
History
apt install -y & apt upgrade -y
Code:
Reading package lists... Done
Building dependency tree 
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up openssh-server (1:8.2p1-4) ...
dpkg: error processing package openssh-server (--configure):
installed openssh-server package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of ssh:
ssh depends on openssh-server (>= 1:8.2p1-4); however:
  Package openssh-server is not configured yet.

dpkg: error processing package ssh (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
openssh-server
ssh
E: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg -i /opt/openssh-server_8.2p1-4_amd64.deb
Code:
(Reading database ... 5956 files and directories currently installed.)
Preparing to unpack .../openssh-server_8.2p1-4_amd64.deb ...
Unpacking openssh-server (1:8.2p1-4) over (1:8.2p1-4) ...
Setting up openssh-server (1:8.2p1-4) ...
dpkg: error processing package openssh-server (--install):
installed openssh-server package post-installation script subprocess returned error exit status 10
Processing triggers for systemd (241-7~deb10u3) ...
Processing triggers for man-db (2.8.5-2) ...
Errors were encountered while processing:
openssh-server

Installed deb package
Code:
/opt/apt-rdepends_1.3.0-7_all.deb                /opt/libhogweed5_3.5.1+really3.5.1-2_amd64.deb
/opt/dkms_2.8.1-5_all.deb                        /opt/libjpeg8_8c-2ubuntu8_amd64.deb
/opt/gcc-10-base_10-20200324-1ubuntu1_amd64.deb  /opt/libjpeg-turbo8_1.5.2-0ubuntu5.18.04.3_amd64.deb
/opt/gcc-10-base_10-20200402-1_amd64.deb         /opt/libnettle7_3.5.1+really3.5.1-2_amd64.deb
/opt/libc6_2.28-10_amd64.deb                     /opt/libnvpair1linux_0.8.3-2_amd64.deb
/opt/libc6_2.29-0ubuntu2_amd64.deb               /opt/libp11-kit0_0.23.17-2_amd64.deb
/opt/libc6_2.30-4_amd64.deb                      /opt/libp11-kit0_0.23.20-1_amd64.deb
/opt/libc6-dev_2.30-4_amd64.deb                  /opt/libproxmox-backup-qemu0_0.1.3-1_amd64.deb
/opt/libc-bin_2.30-4_amd64.deb                   /opt/libproxmox-backup-qemu0-dev_0.1.3-1_amd64.deb
/opt/libcbor0_0.5.0+dfsg-2_amd64.deb             /opt/libspice-server1_0.14.0-1ubuntu2.4_amd64.deb
/opt/libc-dev-bin_2.28-10_amd64.deb              /opt/libspice-server-dev_0.14.0-1ubuntu2.4_amd64.deb
/opt/libc-dev-bin_2.30-4_amd64.deb               /opt/libtasn1-6_4.14-3_amd64.deb
/opt/libc-l10n_2.30-4_all.deb                    /opt/libuutil1linux_0.8.3-2_amd64.deb
/opt/libcrypt1_4.4.16-1_amd64.deb                /opt/libzfs2linux_0.8.3-2_amd64.deb
/opt/libcrypt-dev_4.4.16-1_amd64.deb             /opt/libzpool2linux_0.8.3-2_amd64.deb
/opt/libfdt1_1.6.0-1_amd64.deb                   /opt/locales_2.30-4_all.deb
/opt/libffi7_3.3-4_amd64.deb                     /opt/locales-all_2.30-4_amd64.deb
/opt/libfido2-1_1.3.1-1_amd64.deb                /opt/multiarch-support_2.27-3ubuntu1_amd64.deb
/opt/libfuse3-3_3.9.0-2_amd64.deb                /opt/openssh-client_8.2p1-4_amd64.deb
/opt/libgcc-s1_10-20200402-1_amd64.deb           /opt/openssh-server_8.2p1-4_amd64.deb
/opt/libgfapi0_7.4-1_amd64.deb                   /opt/openssh-sftp-server_8.2p1-4_amd64.deb
/opt/libgfchangelog0_7.4-1_amd64.deb             /opt/pve-qemu-kvm_4.1.1-4_amd64.deb
/opt/libgfrpc0_7.4-1_amd64.deb                   /opt/runit-helper_2.8.15_all.deb
/opt/libgfxdr0_7.4-1_amd64.deb                   /opt/spl-dkms_0.8.3-2_all.deb
/opt/libglusterfs0_7.4-1_amd64.deb               /opt/ssh_8.2p1-4_all.deb
/opt/libglusterfs-dev_7.4-1_amd64.deb            /opt/zfs-dkms_0.8.3-2_all.deb
/opt/libgnutls30_3.6.13-2_amd64.deb              /opt/zfsutils-linux_0.8.3-2_amd64.deb
/opt/libgnutlsxx28_3.6.13-2_amd64.deb

I cannot use apt-get remove openssh-server openssh-client
Because this will delete Proxmox VE together
Code:
W: (pve-apt-hook) !! WARNING !!
W: (pve-apt-hook) You are attempting to remove the meta-package 'proxmox-ve'!
W: (pve-apt-hook)
W: (pve-apt-hook) If you really want to permanently remove 'proxmox-ve' from your system, run the following command
W: (pve-apt-hook)     touch '/please-remove-proxmox-ve'
W: (pve-apt-hook) run apt purge proxmox-ve to remove the meta-package
W: (pve-apt-hook) and repeat your apt invocation.
W: (pve-apt-hook)
W: (pve-apt-hook) If you are unsure why 'proxmox-ve' would be removed, please verify
W: (pve-apt-hook)     - your APT repository settings
W: (pve-apt-hook)     - that you are using 'apt full-upgrade' to upgrade your system
E: Sub-process /usr/share/proxmox-ve/pve-apt-hook returned an error code (1)
E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
 
Last edited:
did you tried to fix the broken with apt -f install or re-config dpkg --configure -a?
 
I fix /var/lib/dpkg/info, I can install&upgrade
Code:
#!/bin/bash
set -e

# Clean out /var/cache/apt/archives
apt-get clean
# Fill it with all the .debs we need
apt-get --reinstall -dy install $(dpkg --get-selections | grep '[[:space:]]install' | cut -f1)

DIR=$(mktemp -d -t info-XXXXXX)
for deb in /var/cache/apt/archives/*.deb
do
    # Move to working directory
    cd "$DIR"
    # Create DEBIAN directory
    mkdir -p DEBIAN
    # Extract control files
    dpkg-deb -e "$deb"
    # Extract file list, fixing up the leading ./ and turning / into /.
    dpkg-deb -c "$deb" | awk '{print $NF}' | cut -c2- | sed -e 's/^\/$/\/./' > DEBIAN/list
    # Figure out binary package name
    DEB=$(basename "$deb" | cut -d_ -f1)
    # Copy each control file into place
    cd DEBIAN
    for file in *
    do
        cp -a "$file" /var/lib/dpkg/info/"$DEB"."$file"
    done
    # Clean up
    cd ..
    rm -rf DEBIAN
done
rmdir "$DIR"
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!