Debian Lenny to Debian Squeeze upgrade problems

Yesterday I made a dist-upgrade on my Debian Lenny server. I thought it will be easy as an usual upgrade, but it's not. I got a lot of problem after the update:

# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-image-2.6-amd64 : Depends: linux-image-2.6.32-5-amd64 but it is not installed
E: Unmet dependencies. Try using -f.

Then I tried the suggestion:

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libio-compress-base-perl libatk1.0-0 libts-0.0-0 libmime-types-perl libc-client2007b libgtk2.0-common libxfixes3 libgsf-1-common
  hicolor-icon-theme libfile-remove-perl libxcomposite1 libltdl3-dev libneon27 libmd5-perl libwmf0.2-7 libilmbase6 libatk1.0-data
  djvulibre-desktop libdirectfb-1.0-0 fam libxinerama1 libcroco3 libopenexr6 libgsf-1-114 libmail-box-perl libdjvulibre21
  openssl-blacklist librsvg2-2 libio-compress-zlib-perl libsysfs2 libbeecrypt6 libxdamage1 libobject-realize-later-perl
  libuser-identity-perl libgtk2.0-bin libxi6 libxcursor1 portmap libxrandr2 libgtk2.0-0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-image-2.6.32-5-amd64
Suggested packages:
  linux-doc-2.6.32
The following NEW packages will be installed:
  linux-image-2.6.32-5-amd64
0 upgraded, 1 newly installed, 0 to remove and 121 not upgraded.
98 not fully installed or removed.
Need to get 0 B/28.6 MB of archives.
After this operation, 103 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "hu_HU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: Nincs ilyen f?jl vagy k?nyvt?r
Preconfiguring packages ...
(Reading database ... 37915 files and directories currently installed.)
Unpacking linux-image-2.6.32-5-amd64 (from .../linux-image-2.6.32-5-amd64_2.6.32-30_amd64.deb) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: Nincs ilyen f?jl vagy k?nyvt?r
dpkg: error processing /var/cache/apt/archives/linux-image-2.6.32-5-amd64_2.6.32-30_amd64.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during `./lib/modules/2.6.32-5-amd64/kernel/sound/pci/hda/snd-hda-codec-realtek.ko': No space left on device
configured to not write apport reports
                                      dpkg-deb: subprocess paste killed by signal (Broken pipe)
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: Nincs ilyen f?jl vagy k?nyvt?r
Running postrm hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.26-2-amd64
Updating /boot/grub/menu.lst ... done

Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-2.6.32-5-amd64_2.6.32-30_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "hu_HU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: Nincs ilyen f?jl vagy k?nyvt?r
/usr/sbin/dpkg-reconfigure: locales is broken or not fully installed

Then I stucked. Do you have any idea how could I solve this?


Solution 1:

You need to read the release notes before upgrading to a new version of Debian. If you just blindly upgraded without reading the release notes an following the instructions you may have broken your system.

This is the quick version from the IRC help channel.

Remove volatile & backports from /etc/apt/sources.list changing lenny to squeeze.

Use apt-get for the upgrade: apt-get update && apt-get upgrade && apt-get install linux-image-$(uname -r|sed 's,[^-]*-[^-]*-,,') udev.

Install firmware-linux-nonfree if needed; check you have a 2.6.32 kernel installed aptitude search '~nlinux-image~i' and reboot into it. apt-get dist-upgrade.

If you did not preform those steps in that order you may end up with a broken system due to the kernel and udev needing to be upgraded first.

Solution 2:

try this:

 apt-get update
 apt-get install --reinstall debconf glibc locales
 dpkg-reconfigure locales

also you can try aptitude (if it is installed), when launch it, press u, then ok, then g, eventually one more g it will try to fix it

Solution 3:

this did the trick for me:

apt-get update
apt-get dist-upgrade
apt-get install --reinstall debconf locales-all
a reboot