I was trying to repair my GRUB after installing Windows over Ubuntu . But i couldn't repair it and asked this question. While discussing with psusi , we notice something. My installed system is 64Bit but my some library files' are 32 bit (for example : libdevmapper.so.1.02.1
).
(You can check step 13 for my question. And check other steps for see which steps i followed.)
- My old Ubuntu was installed on
/dev/sda3
. I mounted it to/mnt/ubusda3
root@ubuntu:/home/ubuntu# file /mnt/ubusda3/sbin/init /mnt/ubusda3/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
root@ubuntu:/home/ubuntu# file /mnt/ubusda3/lib/libdevmapper.so.1.02.1 /mnt/ubusda3/lib/libdevmapper.so.1.02.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
sudo dpkg --root=/mnt/ubusda3 -i /mnt/ubusda3/var/cache/apt/archives/libbz2-1.0_1.0.5-6ubuntu1.11.10.1_amd64.deb
chroot /mnt/ubusda3
apt-get install --reinstall libdevmapper1.02.1
- And then again i tried to
update-grub
i gotmapdevfs: error while loading shared libraries: libdebian-installer.so.4: cannot open shared object file: No such file or directory
error. - I restarted my system but nothing changed.
- i found mapdevfs on
/bin/mapdevfs
withwhich mapdevfs
command. sudo rm /bin/mapdevfs
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt/ubusda3$i"; done
grub-install /dev/sda
- Finally i fix my GRUB problem. Now there is a GRUB menu while booting. Previous Linux Versions screen (and dusts)
But when i choose Ubuntu 3.0.0.17-generic
, it's freezing on loading screen and i'm getting this error :
(Scroll Lock and Num Lock flashing.)
When i choose other kernel versions -which in previous ubuntu versions screen- , i'm getting this error for both of them.
Note 1 (for irrational John)
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# mkdir /mnt/ubusda3
root@ubuntu:/home/ubuntu# mount /dev/sda3 /mnt/ubusda3
root@ubuntu:/home/ubuntu# for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt/ubusda3$i"; done
root@ubuntu:/home/ubuntu# chroot /mnt/ubusda3/
root@ubuntu:/# apt-get -V --reinstall install libnih
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libnih
and then i noticed it's libnih1
not linbih
(http://packages.ubuntu.com/search?keywords=libnih&searchon=names&suite=oneiric§ion=all)
root@ubuntu:/# apt-get -V --reinstall install libnih1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
winbind (3.5.11~dfsg-1ubuntu2.2)
The following packages will be upgraded:
winbind (3.5.11~dfsg-1ubuntu2.1 => 3.5.11~dfsg-1ubuntu2.2)
1 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
Need to get 54.7 kB/5,693 kB of archives.
After this operation, 32.8 kB disk space will be freed.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
libnih1
Install these packages without verification [y/N]? y
Get:1 http://tr.archive.ubuntu.com/ubuntu/ oneiric/main libnih1 amd64 1.0.3-4ubuntu2 [54.7 kB]
Fetched 54.7 kB in 0s (57.1 kB/s)
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 196784 files and directories currently installed.)
Preparing to replace winbind 2:3.5.11~dfsg-1ubuntu2.1 (using .../winbind_2%3a3.5.11~dfsg-1ubuntu2.2_amd64.deb) ...
/sbin/runlevel: error while loading shared libraries: libnih.so.1: wrong ELF class: ELFCLASS32
* Stopping the Winbind daemon winbind
...done.
Unpacking replacement winbind ...
Preparing to replace libnih1 1.0.3-4ubuntu2 (using .../libnih1_1.0.3-4ubuntu2_amd64.deb) ...
Unpacking replacement libnih1 ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up libwbclient0 (2:3.5.11~dfsg-1ubuntu2.2) ...
Setting up samba-common (2:3.5.11~dfsg-1ubuntu2.2) ...
Setting up winbind (2:3.5.11~dfsg-1ubuntu2.2) ...
* Starting the Winbind daemon winbind
/usr/sbin/winbindd: error while loading shared libraries: libcap.so.2: wrong ELF class: ELFCLASS32
...fail!
invoke-rc.d: initscript winbind, action "start" failed.
dpkg: error processing winbind (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up libsmbclient (2:3.5.11~dfsg-1ubuntu2.2) ...
Setting up samba-common-bin (2:3.5.11~dfsg-1ubuntu2.2) ...
Setting up smbclient (2:3.5.11~dfsg-1ubuntu2.2) ...
Setting up libnih1 (1.0.3-4ubuntu2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
winbind
E: Sub-process /usr/bin/dpkg returned an error code (1)
This time i'm getting same boot error for libnih-dbus.so....
file.
Also for finding other 32bit files, i executed your commands and i see all files in /mnt/ubusda3/lib/modules/3.0.0-12-generic/
and /mnt/ubusda3/bin
are 32 bit.
Is it possible to reinstall whole kernel files ?
OK I tried all answers, everything. But I couldn't solve my problem. And finally, I reinstall my Ubuntu.
Are you able to boot into your current install with any of the kernels installed on your system?
Looking at your chat with psusi there is a message with a link to boot-repair paste 938724. It shows your created a GRUB menu with entries for
Have you tried them all and do they all fail the same way? I am just wondering if one of them allows you to boot successfully then perhaps you can then recover by purging/uninstalling a kernel that fails and then reinstall it.
April 24
According to boot-repair paste 938724,
update-grub
found those entries in your/boot
folder when it probed. At least that is what boot-repair found insda3/boot/grub/grub.cfg
.What do you see in your GRUB menu when you boot? Does it resemble the following?
(If you don't get a GRUB menu when you boot, then try pressing/holding the shift key when the boot process starts to unhide the menu.)
If you see a GRUB menu with the entry
Previous Linux versions
, try selecting that entry and pressing enter. You should see another menu with entries for the3.0.0-16
and3.0.0-12
kernels. See what happens when you boot them.April 26
Curiouser and curiouser. OK, so
ELFCLASS32
instead of 64 yet again. Not knowing what else to do, I suggest you follow the procedure you went through during your chat with psusi.chroot
into your broken Ubuntu install in/dev/sda3
. Then runapt-get
to reinstall the correct, 64-bit version oflibnih.so.1
.However, before you do the
chroot
, you might first want to try to find out just how many otherELFCLASS32
files might be present and (potentially) require fixing. I think the commands below will do this.The commands below run the
file
command against every file in the directories/bin
,/sbin
,/lib
, and/lib64
on your Ubuntu install in/dev/sda3
. Thegrep
restricts the output to 32-bit executables.If everything is correct, then these commands should produce **NO output.** Any files listed when your run these commands are 32-bit when they should be 64-bit. They will (probably) need to be reinstalled for your system to work correctly.
Run the commands above after mounting
/dev/sda3
as/mnt/ubu2fix
, but before you do thechroot
. (Or run them in a different terminal which is outside thechroot
.)April 29
I loooked at your Note 1.
Sorry about not noticing earlier your comment that
"all files in
/mnt/ubusda3/lib/modules/3.0.0-12-generic/
and/mnt/ubusda3/bin
are 32 bit."I certainly did not expect this to be the case.
"Is it possible to reinstall whole kernel files ?"
I am not sure what you are asking. (But even if I did I am not sure I would know how to do it. Sorry.)
May 01 - Consider an Upgrade Install from 11.10 to 11.10
Previously, when I read the comment from @Alvar which suggested doing an install to recover your system, I assumed this implied the destruction of your current setup so I ignored it. Now I am not so sure.
It turns out that in a situation like yours where both Ubuntu and Windows are installed in different partitions on the same hard drive, the Ubuntu installer will ask what type of install you want to do as shown in the image below.
I have tried doing an upgrade install from 11.10 to 11.10 in a VirtualBox VM to get a better idea of what it does. It seems to work as it claims. I do have some warnings which I have listed below.
I can't offer you any advice on whether or not re-installing is something you should do. I do not know your situation or what resources you have or do not have at hand.
Some caveats:
Download updates while installing
, the install apparently performs the equivalent of anapt-get dist-upgrade
. I had 8 pending upgrades before the upgrade install. After it completed there were 0 updates pending and a new kernel, 3.0.0-19-generic, had been installed.You need try the distro "Ubuntu Rescue Remix" and boot as live from cd/usb there can use an application for repair de Grub or detect another OS.
It is very easy to use, I working great for me.
Can get the Rescue iso for here:
12.04: http://ubuntu-rescue-remix.org/files/URR/iso/ubuntu-rescue-remix-12-04.iso
11.10: http://ubuntu-rescue-remix.org/files/URR/iso/ubuntu-rescue-remix-11-10.iso
Try booting from a Live CD, and mount the needed device. Copy
to a pendrive, reinstall Ubuntu, and then copy the mozilla directory to your home library. Sorry, my english is horrible. ;-)
I faced this problem when I changed my
BIOS
setting. If you have changed your BIOS setting or even if not just resetBIOS
to default and revert us about result.