You are not logged in.

#1 2021-06-28 10:42:13

toni
Member
Registered: 2011-10-15
Posts: 437

pacman: cannot install any package,error: failed to commit transaction

I have installed Arch into a VirtualBox guest virtual machine (hosted on a WIn10) from the scratch following installation guide.

From the arch-chroot environment I try to install sudo package:

# pacman -S sudo

and I get some interesting errors reading:

error: failed to commit transaction (conflicting files)

and a long list of files followed by exists in filesystem.

It also occurs with any package I try to install, for example dhcpcd.

Any ideas on how to solve it?

Last edited by toni (2021-06-29 13:16:36)

Offline

#2 2021-06-28 11:07:42

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: pacman: cannot install any package,error: failed to commit transaction

Are you certain you have chrooted properly? My suspicion is the files exist because pacman is still reading from the install media rather than the chroot.
Also don't forget that when you are chrooted, you are still root so you don't need the root access for pacman.
Also this also assumes you've done the initial pacstrap of the base install.

Offline

#3 2021-06-28 12:17:52

toni
Member
Registered: 2011-10-15
Posts: 437

Re: pacman: cannot install any package,error: failed to commit transaction

d_fajardo wrote:

Are you certain you have chrooted properly? My suspicion is the files exist because pacman is still reading from the install media rather than the chroot.
Also don't forget that when you are chrooted, you are still root so you don't need the root access for pacman.
Also this also assumes you've done the initial pacstrap of the base install.

I did pacstrap without problems during installation process.
I want to install some packages from arch-chroot environment because from my new installation (logged in using my user), I have no internet connection (i am trying to know why so I am trying to run some commands like dhcpcd but it is not installed and since I have not internet connection but I have within arch-chroot, i want to install this package from there).

So I have booted using live iso, then I have mounted all the points and then enter to arch-chroot environment. Then once within arch-chroot environment, I perform pacman -S sudo or pacman -S dhcpcd and I get those messages and I cannot install any package.

I have correctly chrooted, for example, I can see correct files within /boot, /home directories, etc.

Why?

Last edited by toni (2021-06-28 12:23:59)

Offline

#4 2021-06-28 12:47:46

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: pacman: cannot install any package,error: failed to commit transaction

It does look like you're doing it ok but I have no clue why you are getting those messages. It seems the packages are already installed?
Are you able to boot the new install? If you can you can query pacman if the packages are already installed.
You can try also pacstrap on /mnt i.e. pacstrap /mnt base linux sudo dhcpcd, instead of pacman.

Offline

#5 2021-06-28 12:56:22

toni
Member
Registered: 2011-10-15
Posts: 437

Re: pacman: cannot install any package,error: failed to commit transaction

d_fajardo wrote:

It does look like you're doing it ok but I have no clue why you are getting those messages. It seems the packages are already installed?
Are you able to boot the new install? If you can you can query pacman if the packages are already installed.
You can try also pacstrap on /mnt i.e. pacstrap /mnt base linux sudo dhcpcd, instead of pacman.

Yes I can boot into the new install without problems.
I have tried pacstrap (outside arch-chroot environment) with:

pacstrap /mnt base linux sudo dhcpcd

and the same messages appear.

Maybe.... it is better to reinstall arch again from the scratch into the virtualbox virtual machine. I have no clue why it is happening this.

Offline

#6 2021-06-28 13:17:51

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: pacman: cannot install any package,error: failed to commit transaction

Perhaps the destination install medium has previous install of Linux (guess) ?
It looks like it's better to reinstall.

it is better to reinstall arch again from the scratch into the virtualbox virtual machine

I don't see why installing in virtualbox is better. Just do a normal install but I suggest in which case to wipe the partitions clean with wipefs to begin.
Also did you check the gpg signature check the installation image? I'd recommend to do that if you haven't.

Offline

#7 2021-06-28 13:52:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,438

Re: pacman: cannot install any package,error: failed to commit transaction

Did you by any chance previously try to "fix" the sudo/dhcpcd situation by copying files from eg. the installation medium onto your disk?
=> "man pacman", look for "--overwrite"

Offline

#8 2021-06-29 13:31:27

toni
Member
Registered: 2011-10-15
Posts: 437

Re: pacman: cannot install any package,error: failed to commit transaction

Finally I have reinstalled Arch again from the scratch and now I have Arch operative and working using gnome as desktop environment and with the minium packages installed.
Very sorry, I think I was having trouble installing the packages with pacman because I made a mess betwen the two existing installation modes: UEFI and BIOS.
Initially I followed the installation guide of Arch based on UEFI systems because in fact that was what I wanted, I create an EFI system partition in my virtual hard drive (vhd), a LInux swap and a LVM. I remember that at the begining in the installation process pacman was working well, but in the final steps before restarting the system I applied some bad configuration to the new system installed so when rebooted it was not booting so I had to boot from Arch medium and going into arch-chroot to repair it. But I think I did a big mistake, I mean, in virtualbox virtual machine settings I unchecked EFI so Arch medium booted into BIOS mode so.... booting using BIOS mode and trying to perform a arch-chroot on the new installed system based on UEFI.... I was getting abnormal and weird behaviours of course.....so I think this is the cause why pacman was not working and maybe a long list of files followed by exists in filesystem was outputing as error. Could it be the cause?

Now Arch is installed in my virtualbox virtual machine as guest and hosted into Win10 OS, and it is working ok so I think I am going to close this and mark it as [SOLVED] in the next hours.

Offline

Board footer

Powered by FluxBB