You are not logged in.

#1 2020-03-26 02:23:44

scot
Member
Registered: 2017-04-22
Posts: 8

I replace /usr/share by a softlink and automatically break pacman??

My root partition got maxxed out, and (details not relevant) I decided in the end that I could take the entire directory tree starting at /usr/share, copy it to a new directory /home/share:

     cp  -a /usr/share /home

and then create a softlink of  /home/share back to /use/share

        cd /usr
        sudo ln -s ../home/usr/share/  share



I thought this worked just fine, until today when i tried to install something:


nsaction (conflicting files)
cdrtools: /usr/share exists in filesystem
Errors occurred, no packages were upgraded.
[scott@scott-dell7577 ~]$ sudo pacman -S cdrtools
resolving dependencies...
looking for conflicting packages...

Packages (1) cdrtools-3.02a09-2

Total Installed Size:  4.11 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
error: failed to commit trnsaction (conflicting files)
cdrtools: /usr/share exists in filesystem
Errors occurred, no packages were upgraded.



Please Note that there is no spurious file. It is the directory /usr/share itself: I suppose pacman has noticed that the directory it created many packages ago has been replaced by a softlink. I don't see why this should pacman care , and why the install needs to fail.
I *don't * want pacman to overwrite the softlink; I just want it to use  the directory /usr/share that is on my system, I assume that the --force option will also casue pacman to replace my version of that directoyn(i.e. the soft link) with it's hard directory.\


what set of options could i pass to pacman to tell it to accept the directory structure as is, as long as it succeeds to write the files it needs to write.?

More generally, WHen i need space within some system directory, is there some other better pacman-friendly way? Do I need to avoid transferring some directory to a remote file system that has space,, and then use a soft link to glue it back (so to-speak)  to its original location?

EDIT: Would the option  "--overwrite  !/usr/share"  work? So that once the soft-link is active,  from then on I upgrade /install alwasys with that option\
sudo pacman --overwrite  !/usr/share/  -S <pkg name>

That supposedly means do NOT overwrite the pre-existing directory. But will in then fail when it doesn't overwrite it, or will it happily not overwrite  and successfully complete the upgrade?                                 



thank you

Last edited by scot (2020-03-26 02:41:03)

Offline

#2 2020-03-26 04:08:17

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,139

Re: I replace /usr/share by a softlink and automatically break pacman??

You replaced a pacman-tracked directory with a file (symlinks are a type of file).

Please use mount points instead. If the new location isn't its own filesystem partition, you can use bind-mounts to mount a directory (instead of a partition) to /usr/share.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2020-03-26 11:31:05

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 9,510
Website

Re: I replace /usr/share by a softlink and automatically break pacman??

Please use code tags for terminal output: https://wiki.archlinux.org/index.php/Co … s_and_code

I assume that the --force option will also casue pacman to replace my version

Pacman doesn't have a --force option any more, but yes, I seem to recall that inappropriate use of --force did cause issues for people using symlinks instead of mounts.


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB