[arch-general] Howto - tell pacman -S (-U) to overwrite existing file in filesystem?

Sebastian Rust harlequix at googlemail.com
Sun Feb 20 16:36:11 EST 2011

Hash: SHA1

On 20.02.2011 22:32, David C. Rankin wrote:
> Guys,
> This is a curiosity really. I updated kdebase to create a
trinity.desktop file
> in /etc/X11/sessions in the PKGBUILD package() function:
> # install desktop and update kdmrc and Xsession
> [[ -f trinity.desktop ]] && {
> mkdir -p ${pkgdir}/etc/X11/sessions
> cp trinity.desktop ${pkgdir}/etc/X11/sessions
> }
> <snip>
> Since I had already created trinity.desktop on my box (before it was
part of
> the package), I get (correctly):
> Targets (1): trinity-kdebase-1221588-1
> Total Download Size: 0.00 MB
> Total Installed Size: 86.71 MB
> Proceed with installation? [Y/n]
> checking package integrity...
> checking for file conflicts...
> trinity-kdebase: /etc/X11/sessions/trinity.desktop exists in filesystem
> IIRC this is exactly the way pacman is supposed to work because it has no
> knowledge of a prior trinity.desktop in the filesystem and won't
overwrite it.
> The short answer is "dummy -- remove the file or use --force."
> I get that. The question is "Can I do something in the PKGBUILD to tell
> - if the file is already there -> overwrite it?" The purpose for the
question is
> make sure nobody else gets a conflict if they have followed a prior manual
> Trinity kdm install proceedure.
pacman -S (-U) -f

from man pacman:
       -f, --force
           Bypass file conflict checks and overwrite conflicting
files. If the package that is about to be installed
           contains files that are already installed, this option will
cause all those files to be overwritten. This
           option should be used with care, ideally not at all.
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the arch-general mailing list