LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   dpkg not working after accidental deletion (https://www.linuxquestions.org/questions/debian-26/dpkg-not-working-after-accidental-deletion-4175552359/)

zahidrasheed 09-01-2015 04:33 PM

dpkg not working after accidental deletion
 
I am not sure what I was thinking when I accidently deleted my /etc/dpkg/ folder. While I was fixing that, I tried many things and that made things worst. Now I am in a situation where I can not install or remove anything on my server.
When I try to run something, it ends up on following message:

E: Could not perform immediate configuration on 'multiarch-support'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)


I have tried everything I could :( Can someone please guide me here? Server is debian 6.0
I can not install a fresh copy because I am using ispconfig to manage many domains and there is no way to backup that so I can install a fresh copy and restore stuff without doing a lot of work again.

m_yates 09-02-2015 10:35 AM

It may be helpful if you post the output of "apt-get dist-upgrade". You may find clues to possible fixes here:

https://superuser.com/questions/1995...nfiguration-on

zahidrasheed 09-03-2015 04:35 AM

output of apt-get dist-upgrade
 
Linux ispconfig.baskemus.com 2.6.32-5-amd64 #1 SMP Mon Feb 25 00:26:11 UTC 2013 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Tue Sep 1 23:20:33 2015 from port942.ds1-suoe.adsl.cybercity.dk
ispconfig# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
adduser apt apt-utils base-files base-passwd bash bash-completion bsdmainutils bsdutils ca-certificates coreutils dash dbus debconf debconf-i18n debian-archive-keyring debianutils diffutils dmsetup dpkg e2fslibs e2fsprogs findutils gawk
gcc-5-base gnupg gnupg-curl gpgv grep gzip hostname init init-system-helpers initscripts insserv krb5-locales libacl1 libapparmor1 libapt-inst1.7 libapt-pkg4.16 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libc-bin libc6
libcap-ng0 libcap2 libcap2-bin libcomerr2 libcryptsetup4 libcurl3-gnutls libdb5.3 libdbus-1-3 libdebconfclient0 libdevmapper1.02.1 libexpat1 libfdisk1 libffi6 libgcc1 libgcrypt20 libgmp10 libgnutls-deb0-28 libgpg-error0 libgpm2
libgssapi-krb5-2 libhogweed4 libidn11 libk5crypto3 libkeyutils1 libkmod2 libkrb5-3 libkrb5support0 libldap-2.4-2 liblocale-gettext-perl liblzma5 libmount1 libmpfr4 libncurses5 libncursesw5 libnettle6 libp11-kit0 libpam-cap
libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libpcre3 libprocps4 libreadline6 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libseccomp2 libselinux1 libsemanage-common libsemanage1 libsepol1
libsigsegv2 libsmartcols1 libss2 libssh2-1 libssl1.0.0 libstdc++6 libsystemd0 libtasn1-6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libtinfo5 libudev1 libusb-0.1-4 libustr-1.0-1 libuuid1 login lsb-base mount
multiarch-support ncurses-base ncurses-bin openssl passwd perl-base procps psmisc readline-common sed sensible-utils startpar systemd systemd-sysv sysv-rc sysvinit sysvinit-utils tar tzdata udev util-linux uuid-runtime zlib1g
0 upgraded, 143 newly installed, 0 to remove and 0 not upgraded.
Need to get 12,4 MB/47,5 MB of archives.
After this operation, 149 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.de.debian.org/debian/ sid/main dash amd64 0.5.7-4+b1 [109 kB]
Get:2 http://ftp.de.debian.org/debian/ sid/main libncurses5 amd64 6.0+20150810-1 [94,5 kB]
Get:3 http://ftp.de.debian.org/debian/ sid/main bash amd64 4.3-14 [1.175 kB]
Get:4 http://ftp.de.debian.org/debian/ sid/main bsdutils amd64 1:2.26.2-9 [101 kB]
Get:5 http://ftp.de.debian.org/debian/ sid/main diffutils amd64 1:3.3-1+b1 [267 kB]
Get:6 http://ftp.de.debian.org/debian/ sid/main findutils amd64 4.4.2-9+b1 [485 kB]
Get:7 http://ftp.de.debian.org/debian/ sid/main grep amd64 2.21-2 [340 kB]
Get:8 http://ftp.de.debian.org/debian/ sid/main gzip amd64 1.6-4 [111 kB]
Get:9 http://ftp.de.debian.org/debian/ sid/main hostname amd64 3.16 [14,0 kB]
Get:10 http://ftp.de.debian.org/debian/ sid/main libapparmor1 amd64 2.9.2-3 [63,0 kB]
Get:11 http://ftp.de.debian.org/debian/ sid/main libudev1 amd64 225-1 [93,8 kB]
Get:12 http://ftp.de.debian.org/debian/ sid/main libdevmapper1.02.1 amd64 2:1.02.104-1 [167 kB]
Get:13 http://ftp.de.debian.org/debian/ sid/main dmsetup amd64 2:1.02.104-1 [82,3 kB]
Get:14 http://ftp.de.debian.org/debian/ sid/main libcryptsetup4 amd64 2:1.6.6-5 [103 kB]
Get:15 http://ftp.de.debian.org/debian/ sid/main libkmod2 amd64 21-1 [47,4 kB]
Get:16 http://ftp.de.debian.org/debian/ sid/main libseccomp2 amd64 2.2.3-2 [33,7 kB]
Get:17 http://ftp.de.debian.org/debian/ sid/main libprocps4 amd64 2:3.3.10-2 [58,3 kB]
Get:18 http://ftp.de.debian.org/debian/ sid/main procps amd64 2:3.3.10-2 [245 kB]
Get:19 http://ftp.de.debian.org/debian/ sid/main udev amd64 225-1 [1.035 kB]
Get:20 http://ftp.de.debian.org/debian/ sid/main libcap2-bin amd64 1:2.24-11 [25,9 kB]
Get:21 http://ftp.de.debian.org/debian/ sid/main systemd amd64 225-1 [3.550 kB]
Get:22 http://ftp.de.debian.org/debian/ sid/main systemd-sysv amd64 225-1 [51,8 kB]
Get:23 http://ftp.de.debian.org/debian/ sid/main init amd64 1.23 [5.424 B]
Get:24 http://ftp.de.debian.org/debian/ sid/main login amd64 1:4.2-3 [721 kB]
Get:25 http://ftp.de.debian.org/debian/ sid/main ncurses-bin amd64 6.0+20150810-1 [353 kB]
Get:26 http://ftp.de.debian.org/debian/ sid/main sed amd64 4.2.2-6.1 [243 kB]
Get:27 http://ftp.de.debian.org/debian/ sid/main sysvinit amd64 2.88dsf-59.2 [101 kB]
Get:28 http://ftp.de.debian.org/debian/ sid/main libdebconfclient0 amd64 0.195 [46,3 kB]
Get:29 http://ftp.de.debian.org/debian/ sid/main base-passwd amd64 3.5.38 [60,5 kB]
Get:30 http://ftp.de.debian.org/debian/ sid/main libc-bin amd64 2.19-19 [1.286 kB]
Get:31 http://ftp.de.debian.org/debian/ sid/main ncurses-base all 6.0+20150810-1 [229 kB]
Get:32 http://ftp.de.debian.org/debian/ sid/main bash-completion all 1:2.1-4.2 [179 kB]
Get:33 http://ftp.de.debian.org/debian/ sid/main bsdmainutils amd64 9.0.6 [183 kB]
Get:34 http://ftp.de.debian.org/debian/ sid/main libdbus-1-3 amd64 1.8.20-1 [170 kB]
Get:35 http://ftp.de.debian.org/debian/ sid/main libexpat1 amd64 2.1.0-7 [80,0 kB]
Get:36 http://ftp.de.debian.org/debian/ sid/main dbus amd64 1.8.20-1 [295 kB]
Get:37 http://ftp.de.debian.org/debian/ sid/main libkeyutils1 amd64 1.5.9-7 [12,2 kB]
Get:38 http://ftp.de.debian.org/debian/ sid/main libpam-cap amd64 1:2.24-11 [13,0 kB]
Get:39 http://ftp.de.debian.org/debian/ sid/main libpam-systemd amd64 225-1 [156 kB]
Fetched 12,4 MB in 1s (6.774 kB/s)
E: Could not perform immediate configuration on 'multiarch-support'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)
ispconfig#

zahidrasheed 09-03-2015 07:51 AM

Linux ispconfig.baskemus.com 2.6.32-5-amd64 #1 SMP Mon Feb 25 00:26:11 UTC 2013 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Thu Sep 3 11:34:14 2015 from 10.10.200.225
ispconfig# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
adduser apt apt-utils base-files base-passwd bash bash-completion bsdmainutils bsdutils ca-certificates coreutils dash dbus debconf debconf-i18n debian-archive-keyring debianutils diffutils dmsetup dpkg e2fslibs e2fsprogs findutils gawk
gcc-5-base gnupg gnupg-curl gpgv grep gzip hostname init init-system-helpers initscripts insserv krb5-locales libacl1 libapparmor1 libapt-inst1.7 libapt-pkg4.16 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libc-bin libc6
libcap-ng0 libcap2 libcap2-bin libcomerr2 libcryptsetup4 libcurl3-gnutls libdb5.3 libdbus-1-3 libdebconfclient0 libdevmapper1.02.1 libexpat1 libfdisk1 libffi6 libgcc1 libgcrypt20 libgmp10 libgnutls-deb0-28 libgpg-error0 libgpm2
libgssapi-krb5-2 libhogweed4 libidn11 libk5crypto3 libkeyutils1 libkmod2 libkrb5-3 libkrb5support0 libldap-2.4-2 liblocale-gettext-perl liblzma5 libmount1 libmpfr4 libncurses5 libncursesw5 libnettle6 libp11-kit0 libpam-cap
libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libpcre3 libprocps4 libreadline6 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libseccomp2 libselinux1 libsemanage-common libsemanage1 libsepol1
libsigsegv2 libsmartcols1 libss2 libssh2-1 libssl1.0.0 libstdc++6 libsystemd0 libtasn1-6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libtinfo5 libudev1 libusb-0.1-4 libustr-1.0-1 libuuid1 login lsb-base mount
multiarch-support ncurses-base ncurses-bin openssl passwd perl-base procps psmisc readline-common sed sensible-utils startpar systemd systemd-sysv sysv-rc sysvinit sysvinit-utils tar tzdata udev util-linux uuid-runtime zlib1g
0 upgraded, 143 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/47,5 MB of archives.
After this operation, 149 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
E: Could not perform immediate configuration on 'multiarch-support'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)

m_yates 09-03-2015 09:26 AM

In the link I gave above, they had a similar error after upgrading dpkg. I'm not sure what the cause is, but they indicated that they were able to fix it by manually installing the deb file for the package giving the error. In your case, the package giving the error is multiarch-support. The deb file can be found in /var/cache/apt/archives. You can try installing it manually as they did in that link:

Code:

su
cd /var/cache/apt/archives
dpkg -i multiarch-support*.deb

If that fails, take note of the error. Another poster said manual install failed because of a dependency. The dependent package was noted in the error message. They then tried manually installing the dependent package. They got another error with another dependent package. They repeated the process until they got a package to install manually and then worked their way back through the chain of dependencies until they got the original one (multiarch-support in your case) to install. After that, apt-get dist-upgrade was reported to work as normal. Apt is supposed to automatically take care of dependencies, so I'm not sure what the source of the problem is.

zahidrasheed 09-03-2015 10:01 AM

ispconfig# su
ispconfig# cd /var/cache/apt/archives
ispconfig# dpkg -i multiarch-support*.deb
zsh: command not found: dpkg

m_yates 09-03-2015 10:25 AM

Yikes! I should have read more closely your original post. If you deleted only the /etc/dpkg directory, then your dpkg executable is still on the server. I think the /etc/dpkg contains only configuration options. My suggestion would be to grab a Debian 6 live CD/DVD image (http://cdimage.debian.org/mirror/cdi...64/iso-hybrid/) and boot it on a local computer. Copy the contents of the /etc/dpkg directory while running the live image to a local flash drive. Compress the whole /etc/dpkg directory as an archive that you can uncompress on your server. Then, use ssh/scp to move the archive to your server, uncompress it, and recreate the /etc/dpkg directory. I have no idea if that will get dpkg working again. You may need to set the permissions and owners for all the files and directories in /etc/dpkg. On my Ubuntu PC I am using now, here are the contents of that directory with permissions and owners shown:
Code:

-rw-r--r-- 1 root root  446 Jun 12  2013 dpkg.cfg
drwxr-xr-x 2 root root 4096 Apr 22 08:53 dpkg.cfg.d
drwxr-xr-x 2 root root 4096 Apr 24 09:53 origins
-rw-r--r-- 1 root root  260 Jun 12  2013 shlibs.default
-rw-r--r-- 1 root root  253 Jun 12  2013 shlibs.override

Make sure you take note of permissions and owners of everything on the live CD. That is the only thing I can think to do.

Head_on_a_Stick 09-03-2015 04:00 PM

Quote:

Originally Posted by zahidrasheed (Post 5414433)
Server is debian 6.0

No,it isn't.

Your server is running Debian Unstable (sid); this is not a good idea.

cynwulf 09-03-2015 04:43 PM

I don't think removing /etc/dpkg is your only problem, but just in case:
Code:

# mkdir - p /etc/dpkg/dpkg.cfg.d
# echo "no-debsig\nlog /var/log/dpkg.log" > /etc/dpkg/dpkg.cfg

Also establish if dpkg is actually there:
Code:

$ ls /usr/bin/dpkg
You have the Debian squeeze 2.6.32 kernel, the Debian unstable repositories and when you run dist-ugrade the package manager assumes you want to do just that.

You've also changed root's shell to the Z shell, which is very unwise unless you know exactly what you're doing.

As you've been deleting files and broken the package manager, that seems unlikely.

I suggest backing up your data and reinstalling rather than spending countless hours attempting to fix this.

andre@home 09-04-2015 04:38 AM

+ make next time an image or a clone of your system disk....
Change the cables and your done in a few minutes... next you can re-image/reclone the good system asap....

m_yates 09-04-2015 09:30 AM

My VPS hosting provider has a browser-based interface that allows me to take disk image snapshots, and they store the disk images for me as part of my hosting plan. I can restore from one of the server snapshots with a few mouse clicks. Hopefully the original poster has something similar. I didn't notice that he was attempting to run upgrades from sid. I can't think of a reason why that would ever be a good idea on a server that you care about staying up and running. My VPS runs Wheezy, and I'm not really interested in upgrading to Jessie at this point, much less sid.

cynwulf 09-05-2015 05:35 PM

Quote:

Originally Posted by m_yates (Post 5415770)
I didn't notice that he was attempting to run upgrades from sid. I can't think of a reason why that would ever be a good idea[...]

In all honesty, this appears to be the current state of Debian and Debian usage - in particular with regard to new users.

Over the last few years installing Debian and getting a basic desktop up and running has gotten stupidly easy. So the web is awash with crappy advice in the form of blogs and wikis written by people with basic knowledge at best - or migrants from 'buntu - who consider themselves experienced users because they can run a few nifty commands with a package manager. As ever the problem is "I need version 123 of package_xyz" and of course the 'solution' tends to be: "add the unstable/testing/(buntu/mint!) repository and install it". The average noob thinks it's that easy, yet when it all goes wrong, it's usually Debian's fault or someone else's fault.

There are useful wiki articles of course but few bother to read them: https://wiki.debian.org/DontBreakDebian/

There are people at the quasi official Debian forums with their arses in their hands over this, but it's been going on for years, has gotten worse and can only get worse... on the whole the new age Debian users won't be educated, they want a quick spoonfed solution and to be on their way.


All times are GMT -5. The time now is 05:33 PM.