LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Debian 6 to 7 Upgrade error, apt broken (https://www.linuxquestions.org/questions/linux-newbie-8/debian-6-to-7-upgrade-error-apt-broken-4175522886/)

austinium 10-21-2014 05:48 AM

Debian 6 to 7 Upgrade error, apt broken
 
Decided to upgrade some computers running Debian 6 a.k.a. squeeze to Debian 7 a.k.a. Wheezy today. Been having trouble with the kernel not getting upgraded.

I updated and upgraded the packages in my existing Squeeze installation before changing sources.lst file to wheezy. Then i ran
Code:

#apt-get update
#apt-get upgrade
#apt-get dist-upgrade

It went well mostly, except that i got an error related to the installation of linux-image-amd64. About some dependencies not being met.

So i went about google-ing the errors and ran the following commands:
Code:

root@Debian:~# dpkg --audit
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
 linux-image-amd64    Linux for 64-bit PCs (meta-package)

The following packages are missing the md5sums control file in the
database, they need to be reinstalled:
 gcj-4.7-jre          Java runtime environment using GIJ/classpath
 bogofilter          fast Bayesian spam filter (dummy package)
 gcj-jre-headless    Java runtime environment using GIJ/classpath (headless ve
 default-jre          Standard Java or Java compatible Runtime

Then i tried installing the kernel manually:
Code:

root@Debian:~# apt-get install linux-image-amd64
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following extra packages will be installed:
  linux-image-3.2.0-4-amd64
Suggested packages:
  linux-doc-3.2 debian-kernel-handbook
The following NEW packages will be installed:
  linux-image-3.2.0-4-amd64 linux-image-amd64
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/23.5 MB of archives.
After this operation, 108 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ... 138741 files and directories currently installed.)
Unpacking linux-image-3.2.0-4-amd64 (from .../linux-image-3.2.0-4-amd64_3.2.63-2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-4-amd64_3.2.63-2_amd64.deb (--unpack):
 cannot copy extracted data for './lib/modules/3.2.0-4-amd64/kernel/fs/ocfs2/ocfs2.ko' to '/lib/modules/3.2.0-4-amd64/kernel/fs/ocfs2/ocfs2.ko.dpkg-new': failed to write (No space left on device)
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
Selecting previously unselected package linux-image-amd64.
Unpacking linux-image-amd64 (from .../linux-image-amd64_3.2+46_amd64.deb) ...
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-4-amd64_3.2.63-2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

It says no more room left, so i checked the partitions, they seem fine to me. The error doesn't mention how much more space would be needed either.
Code:

root@Debian:~# df -h
Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                  323M  229M  78M  75% /
udev                                                    10M    0  10M  0% /dev
tmpfs                                                  183M  588K  182M  1% /run
/dev/disk/by-uuid/335223f0-430c-4368-a070-1cdd91c9c3f8  323M  229M  78M  75% /
tmpfs                                                  5.0M    0  5.0M  0% /run/lock
tmpfs                                                  1.1G  88K  1.1G  1% /run/shm
/dev/sda6                                              2.8G  619M  2.1G  24% /home
/dev/sda8                                              369M  17M  333M  5% /tmp
/dev/sda5                                              8.3G  3.7G  4.3G  47% /usr
/dev/sda9                                              444G  77G  344G  19% /var

A little brute force ;)
Code:

root@Debian:~# apt-get install -f
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-image-3.2.0-4-amd64
Suggested packages:
  linux-doc-3.2 debian-kernel-handbook
The following NEW packages will be installed:
  linux-image-3.2.0-4-amd64
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/23.5 MB of archives.
After this operation, 108 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ... 138747 files and directories currently installed.)
Unpacking linux-image-3.2.0-4-amd64 (from .../linux-image-3.2.0-4-amd64_3.2.63-2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-4-amd64_3.2.63-2_amd64.deb (--unpack):
 cannot copy extracted data for './lib/modules/3.2.0-4-amd64/kernel/fs/ocfs2/ocfs2.ko' to '/lib/modules/3.2.0-4-amd64/kernel/fs/ocfs2/ocfs2.ko.dpkg-new': failed to write (No space left on device)
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-4-amd64 /boot/vmlinuz-3.2.0-4-amd64
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-4-amd64_3.2.63-2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The systems seems to have upgraded itself otherwise:
Code:

# lsb_release -a
No LSB modules are available.
Distributor ID:        Debian
Description:        Debian GNU/Linux 7.7 (wheezy)
Release:        7.7
Codename:        wheezy
# cat /etc/issue
Debian GNU/Linux 7 \n \l

So i run aptitude to fix broken packages and I have a system running Wheezy with a Squeeze kernel (?).

From the looks of it i might need to repartition to make room (Squeeze squeezed in just fine, wonder why Wheezys being so touchy on this), I am hoping theres another way out, is there?

EDDY1 10-21-2014 12:15 PM

Try apt-get clean to remove the old archives.
How many kernel images do you have installed?
If you have 2 then remove the oldest.
Quote:

apt-get clean
apt-get update
apt-get upgrade
apt-get dist- upgrade
If that doesn't work you'll have to get a live-cd and resize /.

jlinkels 10-21-2014 08:58 PM

The /lib/modules/3.2.0.4-amd64 for the new kernel needs 107 MB. You only have 78 MB free space.

jlinkels

austinium 10-22-2014 02:59 AM

Thank you jlinkels & EDDY1 :):hattip:

@EDDY1 - i have a separate / partition, its a DI suggested partitioning scheme. I did tweak it a bit, don't really remember if thats the reason i ended up with a 323MB / :scratch:
I had only one kernel in the system. So i had to remove it and then install the new one.

(Risky, yes...but it worked out in the end, and i had a standby in place just in case. Boys & Girls at home - do keep a LiveCD handy and be prepared to chroot in case shit happens!)

Thanks again.

EDDY1 10-22-2014 08:09 AM

Glad to know you got it working.
You may want to resize /.
I resized mine to 2Gig. Also your /home is quite small. You do realize that you have 344Gigs of unused space in /var.


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