You are not logged in.

#1 2015-08-04 21:12:36

Aeos
Member
Registered: 2012-07-26
Posts: 8

[Solved] pacman doesn't work in arch-chroot

Hi,

when I did an update today my PC suddenly shut down for no apparent reason during the update. When I try to boot it now I hang in the bootloader, the 5sec countdown gets reset indefinitely.

I made a Live-USB to chroot into my installation (I followed the wiki). Since the bootmanager seemed having trouble to start I tried "mkinitcpio -p linux" which led to: specified kernel image does not exist. When I try to run pacman -Syu nothing happens, not even synchronisation of core, extra, ....; same for pacman -S linux. I do have a connection to the internet though, ping 8.8.8.8 shows a connection.

I'm out of ideas how to proceed now, save a complete reinstallation (which I'd rather avoid).

Last edited by Aeos (2015-08-08 06:50:29)

Offline

#2 2015-08-04 21:53:42

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] pacman doesn't work in arch-chroot

did you fsck and mount all your partitions before chrooting?

For the mkinitcpio issue I'd suggest reinstalling the kernel from pacman cache, but pacman not working makes me there could be common cause for both issues.

Does the chrooted system work fine apart from these two issues?

Offline

#3 2015-08-05 07:20:01

Aeos
Member
Registered: 2012-07-26
Posts: 8

Re: [Solved] pacman doesn't work in arch-chroot

ooo wrote:

did you fsck and mount all your partitions before chrooting?

I only have / and /home and only mounted /. fsck is fine.

ooo wrote:

For the mkinitcpio issue I'd suggest reinstalling the kernel from pacman cache, but pacman not working makes me there could be common cause for both issues.

Attempting to reinstall the kernel from cache yields the same nonresponse as pacman -Syu.

ooo wrote:

Does the chrooted system work fine apart from these two issues?

If I try man pacman it complains:

man: can't set the locale; make sure $LC_* and $LANG are correct

man fsck works fine on the other hand.

I set my locale to de_AT.utf8, but this seems to be ignored as well, since my keyboard is english.

localectl set-locale LANG=de_AT.utf8 returns this error

Failed to create bus connection: No such file or directory

Would reinstalling pacman as described here help: https://bbs.archlinux.org/viewtopic.php?id=95007?

Offline

#4 2015-08-05 19:09:40

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] pacman doesn't work in arch-chroot

Reinstalling pacman would be a good thing to try, but I wouldn't recommend using that script without any modifications, since its from >5 years ago and would install old version of pacman etc.

I think reinstalling the base group with pacstrap, just as during normal installation, would reinstall pacman and other base packages. To my understanding this should be completely safe, but I can't really be sure, and I'm hoping someone with more knowledge could confirm this. At least backup your configuration files from /etc if you try it, in case pacstrap would overwrite them.

Offline

#5 2015-08-06 02:32:05

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,592

Re: [Solved] pacman doesn't work in arch-chroot

Use pacman's "--root" option to reinstall whatever is needed from the live environment.

Offline

#6 2015-08-06 03:13:13

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [Solved] pacman doesn't work in arch-chroot

pacstrap <root> pacman

would reinstall pacman in your root (root should be a mounted point, e.g. /mnt).


edit: what's the output of

locale

?

Last edited by thiagowfx (2015-08-06 03:14:17)

Offline

#7 2015-08-06 08:11:18

Aeos
Member
Registered: 2012-07-26
Posts: 8

Re: [Solved] pacman doesn't work in arch-chroot

Scimmia wrote:

Use pacman's "--root" option to reinstall whatever is needed from the live environment.

I managed to reinstall pacman with pacman --root /mnt/arch -S --force pacman, (without --force he would complain about existing files and abort). Pacman works now and I was able to do an update and reinstall the kernel.

However, I'm still unable to boot, I seem to have this problem: https://wiki.archlinux.org/index.php/Sy … do_nothing.

Here is my ls -s /boot

total 25696
18108 initramfs-linux-fallback.img     3456 initramfs-linux.img   4 syslinux    4128 vmlinuz-linux

and part of my /boot/syslinux/syslinux.cfg:

# boot sections follow
LABEL arch
        MENU LABEL Arch Linux
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 rw
        INITRD ../initramfs-linux.img

LABEL archfallback
        MENU LABEL Arch Linux Fallback
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 rw
        INITRD ../initramfs-linux-fallback.img

#LABEL windows
#      MENU LABEL Windows
#      COM32 chain.c32
#      APPEND hd0 1

LABEL hdt
        MENU LABEL HDT (Hardware Detection Tool)
        COM32 hdt.c32

LABEL reboot
        MENU LABEL Reboot
        COM32 reboot.c32

LABEL poweroff
       MENU LABEL Poweroff
       COM32 poweroff.c32

When I press Esc in the bootmanager and enter arch I get the following error:

boot:arch
Loading ../vmlinuz-linux... failed: Bad file number
thiagowfx wrote:

edit: what's the output of

locale

?

# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Thanks for all your help so far. :-)

Last edited by Aeos (2015-08-06 08:11:41)

Offline

#8 2015-08-06 20:00:43

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] pacman doesn't work in arch-chroot

I don't see anything wrong with your syslinux.cfg. You could try downgrading the kernel to previous version or linux-lts to make sure it's not an issue with latest kernel.

I just had similar problem after updating my custom kernel to 4.1.4, even though arch kernel with same version boots without issues.

Offline

#9 2015-08-08 06:50:07

Aeos
Member
Registered: 2012-07-26
Posts: 8

Re: [Solved] pacman doesn't work in arch-chroot

I tried installing an older kernel which would let me boot, boot only until Reached Target Graphical Interface. Then the boot process would hang there. So I did another pacman -Syu and now I can boot again. I had to reinstall a few packages (like wine, samba, tracker and talloc, because pacman would complain about empty files) and I no longer see the text during the boot, but I can use it again.

Thanks again. :-)

Last edited by Aeos (2015-08-08 06:51:01)

Offline

Board footer

Powered by FluxBB