Gutted my server

Help with issues regarding installation of Debian

Gutted my server

Postby Soapm » 2016-05-01 06:47

In another thread, I just got my box to run on the proper Jessie kernel. I then started googling for ways to remove the old Wheezy kernel and found this command...

Code: Select all
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge


From this site...

http://askubuntu.com/questions/263363/how-can-i-remove-old-kernels-install-new-ones-when-boot-is-full

Before I knew it, my server was deleting file after file to include both kernels. I finally stopped it with a cntl+c, but my install is very botched... This is why I hate when people say try google first, because you don't know the quality of the advice you're seeing...

Anyway, I tried to reinstall the kernel and it said to do;

Code: Select all
dpkg --configure -a


I run that and get this...

Code: Select all
root@lenny:/# dpkg --configure -a
Setting up libregexp-common-perl (2013031301-1) ...
Setting up libhtml-tagset-perl (3.20-2) ...
Setting up liblist-moreutils-perl (0.33-2+b1) ...
Setting up libconfig-file-perl (1.50-2) ...
Setting up libclass-c3-xs-perl (0.13-2+b1) ...
Setting up libsub-install-perl (0.928-1) ...
Setting up libpackage-constants-perl (0.04-1) ...
Setting up libdata-optlist-perl (0.109-1) ...
Setting up libmp3-tag-perl (1.13-1) ...
Setting up less (458-3) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package less (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up libfont-afm-perl (1.20-1) ...
Setting up libaudio-flac-header-perl (2.4-2+b1) ...
Setting up libperl4-corelibs-perl (0.003-1) ...
Setting up libaudio-musepack-perl (1.0.1-1) ...
Setting up libegl1-mesa-drivers:amd64 (10.3.2-1+deb8u1) ...
Setting up libconfig-inifiles-perl (2.83-3) ...
Setting up apt-show-versions (0.22.4) ...
** initializing cache. This may take a while **
Setting up libarchive-zip-perl (1.39-1) ...
Setting up base-passwd (3.5.37) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package base-passwd (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up acpi-support-base (0.142-6) ...
Setting up libsocket-perl (2.016-1) ...
Setting up po-debconf (1.0.16+nmu3) ...
dpkg: dependency problems prevent configuration of apt-offline:
 apt-offline depends on less; however:
  Package less is not configured yet.

dpkg: error processing package apt-offline (--configure):
 dependency problems - leaving unconfigured
Setting up libxml-namespacesupport-perl (1.11-1) ...
Setting up libio-pty-perl (1:1.08-1+b4) ...
Setting up libfile-which-perl (1.09-1) ...
Setting up libencode-locale-perl (1.03-1) ...
Setting up libintl-perl (1.23-1) ...
Setting up liberror-perl (0.17-1.1) ...
Setting up libtimedate-perl (2.3000-2) ...
Setting up rename (0.20-3) ...
Setting up i2c-tools (3.1.1-1) ...
Setting up apt-utils (1.0.9.8.3) ...
Setting up debconf (1.5.56) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package debconf (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of debconf-i18n:
 debconf-i18n depends on debconf (= 1.5.56); however:
  Package debconf is not configured yet.

dpkg: error processing package debconf-i18n (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of default-jre:
 default-jre depends on openjdk-7-jre (>= 7~u3-2.1.1); however:
  Package openjdk-7-jre is not installed.

dpkg: error processing package default-jre (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of tzdata:
 tzdata depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package tzdata (--configure):
 dependency problems - leaving unconfigured
Setting up libfile-homedir-perl (1.00-1) ...
Setting up libfile-basedir-perl (0.03-1) ...
dpkg: dependency problems prevent configuration of quota:
 quota depends on debconf (>= 1.2.9) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package quota (--configure):
 dependency problems - leaving unconfigured
Setting up mesa-vdpau-drivers:amd64 (10.3.2-1+deb8u1) ...
Setting up libio-html-perl (1.001-1) ...
Setting up libkrb5-dev (1.12.1+dfsg-19+deb8u2) ...
Setting up libtext-unidecode-perl (1.22-1) ...
Setting up dash (0.5.7-4+b1) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package dash (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-base:
 linux-base depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package linux-base (--configure):
 dependency problems - leaving unconfigured
Setting up libtie-ixhash-perl (1.23-1) ...
Setting up libdpkg-perl (1.17.26) ...
Setting up ndisc6 (1.0.1-1+b1) ...
dpkg: dependency problems prevent configuration of samba-common:
 samba-common depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package samba-common (--configure):
 dependency problems - leaving unconfigured
Setting up libtext-soundex-perl (3.4-1+b2) ...
Setting up autoconf (2.69-8) ...
Setting up rpm (4.11.3-1.1) ...
dpkg: dependency problems prevent configuration of ghostscript:
 ghostscript depends on debconf | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package ghostscript (--configure):
 dependency problems - leaving unconfigured
Setting up libswitch-perl (2.17-2) ...
Setting up libpod-latex-perl (0.61-1) ...
Setting up docbook-xml (4.5-7.2) ...
Setting up gawk (1:4.1.1+dfsg-1) ...
Setting up libmp4-info-perl (1.13-1) ...
Setting up libyaml-tiny-perl (1.64-1) ...
Setting up liblog-message-simple-perl (0.10-2) ...
dpkg: dependency problems prevent configuration of mdadm:
 mdadm depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.
 mdadm depends on debconf; however:
  Package debconf is not configured yet.

dpkg: error processing package mdadm (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ucf:
 ucf depends on debconf (>= 1.5.19); however:
  Package debconf is not configured yet.

dpkg: error processing package ucf (--configure):
 dependency problems - leaving unconfigured
Setting up libcurses-perl (1.32-1) ...
Setting up libcgi-fast-perl (1:2.04-1) ...
Setting up libterm-readkey-perl (2.32-1+b1) ...
dpkg: dependency problems prevent configuration of sysvinit-core:
 sysvinit-core depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package sysvinit-core (--configure):
 dependency problems - leaving unconfigured
Setting up isc-dhcp-client (4.3.1-6+deb8u2) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package isc-dhcp-client (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up libsub-exporter-perl (0.986-1) ...
Setting up libalgorithm-merge-perl (0.08-2) ...
dpkg: dependency problems prevent configuration of beep:
 beep depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package beep (--configure):
 dependency problems - leaving unconfigured
Setting up dpkg-dev (1.17.26) ...
Setting up libpod-readme-perl (0.11-1) ...
dpkg: dependency problems prevent configuration of openssh-server:
 openssh-server depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package openssh-server (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpam-winbind:amd64:
 libpam-winbind:amd64 depends on samba-common (= 2:4.2.10+dfsg-0+deb8u2); however:
  Package samba-common is not configured yet.

dpkg: error processing package libpam-winbind:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of smbclient:
 smbclient depends on samba-common (= 2:4.2.10+dfsg-0+deb8u2); however:
  Package samba-common is not configured yet.

dpkg: error processing package smbclient (--configure):
 dependency problems - leaving unconfigured
Setting up libalgorithm-diff-xs-perl (0.04-3+b1) ...
Setting up debian-ports-archive-keyring (2015.01.28) ...
Setting up libfile-desktopentry-perl (0.07-1) ...
dpkg: dependency problems prevent configuration of exim4:
 exim4 depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.
 exim4 depends on debconf (>= 1.4.69) | cdebconf (>= 0.39); however:
  Package debconf is not configured yet.
  Package cdebconf is not installed.
 exim4 depends on exim4-base (>= 4.84.2-1); however:
  Package exim4-base is not installed.
 exim4 depends on exim4-base (<< 4.84.2-1.1); however:
  Package exim4-base is not installed.

dpkg: error processing package exim4 (--configure):
 dependency problems - leaving unconfigured
Setting up sgmlspl (1.03ii-33) ...
dpkg: dependency problems prevent configuration of mcelog:
 mcelog depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package mcelog (--configure):
 dependency problems - leaving unconfigured
Setting up libhtml-parser-perl (3.71-1+b3) ...
Setting up automake (1:1.14.1-4) ...
Setting up ftp (0.17-31) ...
Setting up libterm-ui-perl (0.42-1) ...
dpkg: dependency problems prevent configuration of apt-listchanges:
 apt-listchanges depends on ucf (>= 0.28); however:
  Package ucf is not configured yet.
 apt-listchanges depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package apt-listchanges (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of texlive-base:
 texlive-base depends on ucf; however:
  Package ucf is not configured yet.
 texlive-base depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package texlive-base (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of texlive-latex-recommended-doc:
 texlive-latex-recommended-doc depends on texlive-base (>= 2014); however:
  Package texlive-base is not configured yet.

dpkg: error processing package texlive-latex-recommended-doc (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of texlive-fonts-recommended-doc:
 texlive-fonts-recommended-doc depends on texlive-base (>= 2014); however:
  Package texlive-base is not configured yet.

dpkg: error processing package texlive-fonts-recommended-doc (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sysv-rc:
 sysv-rc depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package sysv-rc (--configure):
 dependency problems - leaving unconfigured
Setting up debian-edu-archive-keyring (2014.10.14) ...
OK
dpkg: dependency problems prevent configuration of man-db:
 man-db depends on debconf (>= 1.2.0) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package man-db (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ps2eps:
 ps2eps depends on ghostscript; however:
  Package ghostscript is not configured yet.

dpkg: error processing package ps2eps (--configure):
 dependency problems - leaving unconfigured
Setting up checkinstall (1.6.2-4) ...
dpkg: dependency problems prevent configuration of exim4-daemon-light:
 exim4-daemon-light depends on exim4-base (>= 4.84.2); however:
  Package exim4-base is not installed.
 exim4-daemon-light depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package exim4-daemon-light (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libtcl8.6:amd64:
 libtcl8.6:amd64 depends on tzdata; however:
  Package tzdata is not configured yet.

dpkg: error processing package libtcl8.6:amd64 (--configure):
 dependency problems - leaving unconfigured
Setting up xmlto (0.0.25-2) ...
dpkg: dependency problems prevent configuration of libpam0g:amd64:
 libpam0g:amd64 depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package libpam0g:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba:
 samba depends on samba-common (= 2:4.2.10+dfsg-0+deb8u2); however:
  Package samba-common is not configured yet.

dpkg: error processing package samba (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of texlive-fonts-recommended:
 texlive-fonts-recommended depends on texlive-base (>= 2014); however:
  Package texlive-base is not configured yet.

dpkg: error processing package texlive-fonts-recommended (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of login:
 login depends on libpam0g (>= 0.99.7.1); however:
  Package libpam0g:amd64 is not configured yet.

dpkg: error processing package login (--configure):
 dependency problems - leaving unconfigured
Setting up bc (1.06.95-9) ...
Setting up gnupg-agent (2.0.26-6) ...
dpkg: dependency problems prevent configuration of texlive-bibtex-extra:
 texlive-bibtex-extra depends on texlive-base (>= 2014); however:
  Package texlive-base is not configured yet.

dpkg: error processing package texlive-bibtex-extra (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba-common-bin:
 samba-common-bin depends on samba-common (= 2:4.2.10+dfsg-0+deb8u2); however:
  Package samba-common is not configured yet.

dpkg: error processing package samba-common-bin (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of initscripts:
 initscripts depends on sysv-rc | file-rc; however:
  Package sysv-rc is not configured yet.
  Package file-rc is not installed.

dpkg: error processing package initscripts (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of x11-common:
 x11-common depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package x11-common (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ca-certificates:
 ca-certificates depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package ca-certificates (--configure):
 dependency problems - leaving unconfigured
Setting up libcurses-ui-perl (0.9609-1) ...
dpkg: dependency problems prevent configuration of texlive:
 texlive depends on texlive-fonts-recommended (>= 2014); however:
  Package texlive-fonts-recommended is not configured yet.

dpkg: error processing package texlive (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of texlive-generic-recommended:
 texlive-generic-recommended depends on texlive-base (>= 2014); however:
  Package texlive-base is not configured yet.

dpkg: error processing package texlive-generic-recommended (--configure):
 dependency problems - leaving unconfigured
Setting up libfile-mimeinfo-perl (0.26-1) ...
dpkg: dependency problems prevent configuration of python-pip:
 python-pip depends on ca-certificates; however:
  Package ca-certificates is not configured yet.

dpkg: error processing package python-pip (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of irqbalance:
 irqbalance depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package irqbalance (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cron:
 cron depends on libpam0g (>= 0.99.7.1); however:
  Package libpam0g:amd64 is not configured yet.

dpkg: error processing package cron (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of texlive-latex-base:
 texlive-latex-base depends on texlive-base (>= 2014); however:
  Package texlive-base is not configured yet.

dpkg: error processing package texlive-latex-base (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of locales:
 locales depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package locales (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of logrotate:
 logrotate depends on cron | anacron | cron-daemon; however:
  Package cron is not configured yet.
  Package anacron is not installed.
  Package cron-daemon is not installed.
  Package cron which provides cron-daemon is not configured yet.
 logrotate depends on base-passwd (>= 2.0.3.4); however:
  Package base-passwd is not configured yet.

dpkg: error processing package logrotate (--configure):
 dependency problems - leaving unconfigured
Setting up git (1:2.1.4-2.1+deb8u2) ...
dpkg: dependency problems prevent configuration of texlive-latex-base-doc:
 texlive-latex-base-doc depends on texlive-base (>= 2014); however:
  Package texlive-base is not configured yet.

dpkg: error processing package texlive-latex-base-doc (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of memtest86+:
 memtest86+ depends on debconf (>= 0.5) | debconf-2.0; however:
  Package debconf is not configured yet.
  Package debconf-2.0 is not installed.
  Package debconf which provides debconf-2.0 is not configured yet.

dpkg: error processing package memtest86+ (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of rsyslog:
 rsyslog depends on initscripts (>= 2.88dsf-13.3); however:
  Package initscripts is not configured yet.

dpkg: error processing package rsyslog (--configure):
 dependency problems - leaving unconfigured
dpkg: too many errors, stopping
Processing triggers for libc-bin (2.19-18+deb8u4) ...
Errors were encountered while processing:
 less
 base-passwd
 apt-offline
 debconf
 debconf-i18n
 default-jre
 tzdata
 quota
 dash
 linux-base
 samba-common
 ghostscript
 mdadm
 ucf
 sysvinit-core
 isc-dhcp-client
 beep
 openssh-server
 libpam-winbind:amd64
 smbclient
 exim4
 mcelog
 apt-listchanges
 texlive-base
 texlive-latex-recommended-doc
 texlive-fonts-recommended-doc
 sysv-rc
 man-db
 ps2eps
 exim4-daemon-light
 libtcl8.6:amd64
 libpam0g:amd64
 samba
 texlive-fonts-recommended
 login
 texlive-bibtex-extra
 samba-common-bin
 initscripts
 x11-common
 ca-certificates
 texlive
 texlive-generic-recommended
 python-pip
 irqbalance
 cron
 texlive-latex-base
 locales
 logrotate
 texlive-latex-base-doc
 memtest86+
 rsyslog
Processing was halted because there were too many errors.


this is botched up bad, anyway to reinstall over the top of this installation or is there a repair sequence that will at lest get my basic install back running? I would hate to fdisk and start from scratch, this this looks bad...
User avatar
Soapm
 
Posts: 541
Joined: 2012-05-22 04:23

Re: Gutted my server

Postby dilberts_left_nut » 2016-05-01 07:36

Soapm wrote:
Code: Select all
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
Wow - that was a bad move.

Reinstallation is the realistic move (back up the files so you can restore wanted configs to your new system) - you can try working your way through the errors, and you may get lucky, but at a quick glance it looks complex and time consuming to solve, but you will likely get a lot of learning if you choose that path. :)
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Gutted my server

Postby Soapm » 2016-05-01 12:55

Are you suggesting the fdisk with new install or can I just install over the top of the current install without wiping the disk?

I still have all the backup files listed in the upgrade instructions from Wheezy to Jessie, at what point in the install do I copy them back to their current location?
User avatar
Soapm
 
Posts: 541
Joined: 2012-05-22 04:23

Re: Gutted my server

Postby kiyop » 2016-05-01 13:55

Soapm wrote:I then started googling for ways to remove the old Wheezy kernel and found this command...

Code: Select all
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge


From this site...

http://askubuntu.com/questions/263363/how-can-i-remove-old-kernels-install-new-ones-when-boot-is-full

Before I knew it, my server was deleting file after file to include both kernels. I finally stopped it with a cntl+c, but my install is very botched... This is why I hate when people say try google first, because you don't know the quality of the advice you're seeing...

Be careful not breaking debian by executing bad commands written in pages on internet.
The page you linked does not deal debian, but deals UBUNTU.
Furthermore, there are some useful comments just after the post describing the code:
The command is useful, just run the part before "| xargs" first to check what you are going to delete. Also, | grep -v may be needed to preserve the latest kernel, which may not be in use yet, but wanted. – Roman Susi May 5 '15 at 6:10

this is dangerous as it also matches linux-libc-dev:amd64 – Frederick Nord Aug 31 '15 at 11:07


I suggest you understanding what the command to be executed by you do, before you execute the command.

You can know what packages were uninstalled ("remove"d or "purge"d) by reading /var/log/dpkg.log*
You can install all the packages uninstalled by the above bad command (code).
dilberts_left_nut knows better than I.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/
User avatar
kiyop
 
Posts: 3984
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan

Re: Gutted my server

Postby dasein » 2016-05-01 17:51

kiyop wrote:I suggest you understanding what the command to be executed by you do, before you execute the command.

+1

Those same comments also say:
in general, people should be advised away from running commands like this they don't understand
which qualifies as computer hygiene 101.

tl;dr: The problem isn't Google. It's failure to read instructions.
User avatar
dasein
 
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Gutted my server

Postby Soapm » 2016-05-02 01:59

Understood but to be fair, I wouldn't run any command since I don't understand most of what I do in Linux.

And the link says "remove old kernels", I had no idea someone would give a command that removes the kernel plus a lot more. But that's the price you pay for not knowing your OS, it's kind of danged if you do and danged if you don't google...
User avatar
Soapm
 
Posts: 541
Joined: 2012-05-22 04:23

Re: Gutted my server

Postby GarryRicketson » 2016-05-02 03:09

I wouldn't run any command since I don't understand most of what I do in Linux.

You could have posted the command here, BEFORE you tried it, and asked about it.
We would see that you had at least tried to do a search, and that is good, but if and when you do not understand what some of the results in the search will do, that is definitely when it is time to ask somebody.
Example:
This is my problem ,(explantation and details on the problem/question)
I did some searches and found this:
Code: Select all
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

It says that code is for removing a kernel and installing a new one,does this code look correct ? Is it safe ? What does it do ?

Pay particular attention, to what OS, or distro, the code is intended for. Debian is not Ubuntu,.. Any way, it is to late now, but at least maybe you learned something from this.
User avatar
GarryRicketson
 
Posts: 5193
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Gutted my server

Postby dilberts_left_nut » 2016-05-02 03:17

Using '-y' (to automatically say yes to any question) is severely discouraged in nearly all situations, let alone when accepting an unverified list of packages to purge...

You REALLY need to check these types of commands, by using -s to simulate any package operations, or at least just running the section before the pipe to examine the list it generates.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Gutted my server

Postby Soapm » 2016-05-02 03:43

Understood, thanks for the advice... I never thought to run my findings to by the group to show I did try...

Anyway, you guys won't believe this but I managed to fix it.

The problem had to do with this error;

Code: Select all
DbDriver "config": /var/cache/debconf/config.dat


So I found a site that suggested to run this command then kill the active PID.

Code: Select all
fuser -v /var/cache/debconf/config.dat


After that I did;

Code: Select all
dpkg --configure -a


and it took about 45 minutes but it sat there configuring package after package. It then gave me a list of about 7 half installed packages. So I want into /var/lib/dpkg/status and changed their status to "deinstall ok config-files" (Google). Once that was done I was able to reinstall those packages, the kernel and grub-efi to make sure they were ok, and by George, I think she's running again. How can you not like Linux, I don't understand it but it sure is a neat OS...

But it still leaves me with the original problem, the Wheezy kernel is still there except now it shows partially installed...

Code: Select all
root@lenny:~# dpkg --list | egrep -i --color 'linux-image|linux-headers'
ii  linux-headers-3.16.0-4-amd64       3.16.7-ckt25-1                       amd64        Header files for Linux 3.16.0-4-amd64
ii  linux-headers-3.16.0-4-common      3.16.7-ckt25-1                       amd64        Common header files for Linux 3.16.0-4
ii  linux-image-3.16.0-4-amd64         3.16.7-ckt25-1                       amd64        Linux 3.16 for 64-bit PCs
pi  linux-image-3.2.0-4-amd64          3.2.65-1+deb7u2                      amd64        Linux 3.2 for 64-bit PCs
ii  linux-image-3.2.0-4-amd64-dbg      3.2.65-1+deb7u2                      amd64        Debugging symbols for Linux 3.2.0-4-amd64
ii  linux-image-amd64                  3.16+63                              amd64        Linux for 64-bit PCs (meta-package)


and I'm getting this error in Grub...

Code: Select all
root@lenny:~# efibootmgr --verbose | grep debian
efibootmgr: Skipping unreadable variable Boot0001: Input/output error
Boot0000* debian        HD(1,800,f3800,2ea4f871-a97a-4fab-8cdc-c01031f76856)File(\EFI\debian\grubx64.efi)
User avatar
Soapm
 
Posts: 541
Joined: 2012-05-22 04:23

Re: Gutted my server

Postby dilberts_left_nut » 2016-05-02 06:55

Soapm wrote:Anyway, you guys won't believe this but I managed to fix it

Nice :D

Which kernel is currently running? (uname -a).

Maybe use the aptitude interface to search through the header and kernel packages and pick exactly the ones you want to purge, then confirm there are no other packages in the action list before saying (g)o.

Not up with EFI booting so can't help there sorry, maybe a grub reinstall might fix it if it was a missing kernel that was still referenced in grub on the last run or such.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Gutted my server

Postby Soapm » 2016-05-02 19:32

Code: Select all
root@lenny:~# uname -r
3.16.0-4-amd64


dilberts_left_nut wrote:
Soapm wrote:Anyway, you guys won't believe this but I managed to fix it

Nice :D

Which kernel is currently running? (uname -a).

Maybe use the aptitude interface to search through the header and kernel packages and pick exactly the ones you want to purge, then confirm there are no other packages in the action list before saying (g)o.


That was easy for you to say, here is an aptitude -search linux-image.

It seems I can remove linux-image-3.2.0-4-amd64 and linux-image-3.2.0-4-amd64-dbg .

Would i just do aptitude remove linux-image-3.2.0-4-amd64? Is that it? I'm kind of gun shy after the last debacle...

Code: Select all
root@lenny:~# aptitude search linux-image
v   linux-image                               -
i   linux-image-3.16.0-4-amd64                - Linux 3.16 for 64-bit PCs
p   linux-image-3.16.0-4-amd64-dbg            - Debugging symbols for Linux 3.16.0-4-amd64
ip  linux-image-3.2.0-4-amd64                 - Linux 3.2 for 64-bit PCs
iB  linux-image-3.2.0-4-amd64-dbg             - Debugging symbols for Linux 3.2.0-4-amd64
p   linux-image-4.5.0-0.bpo.1-amd64           - Linux 4.5 for 64-bit PCs
p   linux-image-4.5.0-0.bpo.1-amd64-dbg       - Debugging symbols for Linux 4.5.0-0.bpo.1-amd64
i   linux-image-amd64                         - Linux for 64-bit PCs (meta-package)
p   linux-image-amd64-dbg                     - Debugging symbols for Linux amd64 configuration (met
p   linux-image-rt-amd64                      - Linux for 64-bit PCs (meta-package), PREEMPT_RT
p   linux-image-rt-amd64-dbg                  - Debugging symbols for Linux rt-amd64 configuration (
root@lenny:~#
User avatar
Soapm
 
Posts: 541
Joined: 2012-05-22 04:23

Re: Gutted my server

Postby kiyop » 2016-05-03 07:02

Soapm wrote:Understood but to be fair, I wouldn't run any command since I don't understand most of what I do in Linux.

You may be able to understand what a command will do by reading manual. Manual of command, such as "COMMAND", can be displayed by
Code: Select all
man COMMAND

Often, the manual shown by the above command is difficult to understand.
You can also get information of a command by googling ;) ;)

Anyway, congratulations on your success on repairing your debian :)

Soapm wrote:It seems I can remove linux-image-3.2.0-4-amd64 and linux-image-3.2.0-4-amd64-dbg .

Would i just do aptitude remove linux-image-3.2.0-4-amd64? Is that it? I'm kind of gun shy after the last debacle...

Yes, if your debian is working properly (with linux-image-3.16.0-4-amd64).
Does the service provided by your debian work properly?

If so, also you can remove linux-image-3.2.0-4-amd64-dbg
Code: Select all
apt-get purge linux-image-3.2.0.4*


Read again https://www.debian.org/releases/jessie/ ... ng.en.html , especially, after https://www.debian.org/releases/jessie/ ... ml#trouble and also https://www.debian.org/releases/jessie/ ... on.en.html
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/
User avatar
kiyop
 
Posts: 3984
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan

Removing old Kernels

Postby Soapm » 2018-10-09 23:33

I am again at the point of removing old kernels...

Code: Select all
root@lenny:~# uname -mrs
Linux 4.9.0-8-amd64 x86_64


Code: Select all
root@lenny:/# dpkg --list | egrep -i --color 'linux-image|linux-headers'
ii  linux-image-4.9.0-4-amd64           4.9.65-3+deb9u1                      amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-4.9.0-5-amd64           4.9.65-3+deb9u2                      amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-4.9.0-6-amd64           4.9.88-1+deb9u1                      amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-4.9.0-7-amd64           4.9.110-3+deb9u2                     amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-4.9.0-8-amd64           4.9.110-3+deb9u6                     amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-amd64                   4.9+80+deb9u6                        amd64        Linux for 64-bit PCs (meta-package)


I'm obviously gun shy after gutting my server before, what command would you guys suggest to clean out my unused kernels?

Should I do them one by one using a derivative of "apt-get purge linux-image-3.2.0.4*"?
User avatar
Soapm
 
Posts: 541
Joined: 2012-05-22 04:23

Re: Gutted my server

Postby Head_on_a_Stick » 2018-10-10 05:15

I would leave
Code: Select all
ii  linux-image-4.9.0-8-amd64           4.9.110-3+deb9u6                     amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-amd64                   4.9+80+deb9u6                        amd64        Linux for 64-bit PCs (meta-package)

and remove the rest.

The metapackage currently depends on that version:

https://packages.debian.org/stretch/linux-image-amd64

My command would be
Code: Select all
# aptitude purge linux-image-4.9.0-{4,5,6,7}-amd64

Be aware though that aptitude auto-autoremoves so make sure your metapackages are in order before running that.
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8322
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Gutted my server

Postby Soapm » 2018-10-12 05:12

Hey head_on_a_stick, I forgot to come back and say thanks. I appreciate your expertise and noted your command for future reference.
User avatar
Soapm
 
Posts: 541
Joined: 2012-05-22 04:23


Return to Installation

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable