Package to uninstall plus purge its config files

Configuration of installed LibreOffice may be messy. Hence the plan is to purge the package inclusively configuration files. Manjaro GUI tool Add/Remove Software was used once to install this LO.

Attempt to do it in command line fails however:

$ sudo pacman -R -s --nosave libreoffice 
error: target not found: libreoffice
$ sudo pacman -R -s --nosave libreoffice-still
[sudo] password for userA: 
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing libreoffice-still breaks dependency 'libreoffice-still' required by libreoffice-still-de

As of time being Add/Remove Software presents the package libreoffice-still as present on system (Remove, and Reinstall options are offered to user). One could invoke Remove in Add/Remove Software right now, no idea however how to remove the package inclusively its configuration files following this track.

sudo pacman -Rsu libreoffice-still

if you are fan of the command line, if not, just remove libreoffice-still-de manually before that as stated by the error.

Edit: you also wanted to clean the config so

sudo pacman -Rsun libreoffice-still
1 Like

pacman by default wont remove files in your home.
So, for example, ~/.config/libreoffice will be left behind no matter what removal flags you use.

$ sudo pacman -Rsun libreoffice-still
[sudo] password for userA: 
checking dependencies...
warning: removing libreoffice-still from target list
warning: removing libwpd from target list
warning: removing libwps from target list
warning: removing neon from target list
warning: removing redland from target list
warning: removing lpsolve from target list
warning: removing libvisio from target list
warning: removing libetonyek from target list
warning: removing libodfgen from target list
warning: removing libcdr from target list
warning: removing libmspub from target list
warning: removing clucene from target list
warning: removing libpagemaker from target list
warning: removing libabw from target list
warning: removing libmwaw from target list
warning: removing libe-book from target list
warning: removing liblangtag from target list
warning: removing libexttextcat from target list
warning: removing liborcus from target list
warning: removing libtommath from target list
warning: removing libzmf from target list
warning: removing libatomic_ops from target list
warning: removing xmlsec from target list
warning: removing libnumbertext from target list
warning: removing libfreehand from target list
warning: removing libstaroffice from target list
warning: removing libepubgen from target list
warning: removing libqxp from target list
warning: removing box2d from target list
warning: removing zxing-cpp from target list
warning: removing librevenge from target list
warning: removing libixion from target list
warning: removing libwpg from target list
warning: removing rasqal from target list
warning: removing raptor from target list
warning: removing boost-libs from target list
 there is nothing to do
$

Subsequently, libreoffice-still and libreoffice-still-de still presented by Add/Remove Software as installed packages and that one LO app in intensive use currently still starts successfully if to start it from apps menu. Hence the command above seems to haven’t been effective.

Can invoke Remove in Add/Remove Software but unsure how it handles config files.


Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text

Thanks for hint.

Unclear what exactly is in mind.

Go to add remove programs, search for libreoffice-still-de and remove and hit apply. Close adremove progs. Reopen it and then try to remove libreoffice-still. Don’t do it all at once.

If to initiate package removal from Add/Remove Software over all 36 packages are reported as removal target - these must be LO-package and all its dependencies (Add/Remove Software LO-removal process indicates all those but two as libreoffice-still orphans).

How will config files handled following this track?

Files installed by a package is removed when you remove the package.

Files created when you run the packaged application is retained as they reside in your home folder.

Read the manual - especially for the options related to the -R/–remove command

REMOVE OPTIONS (APPLY TO -R)
       -c, --cascade
           Remove all target packages, as well as all packages that
           depend on one or more target packages. This operation is
           recursive and must be used with care, since it can remove many
           potentially needed packages.

       -n, --nosave
           Instructs pacman to ignore file backup designations. Normally,
           when a file is removed from the system, the database is
           checked to see if the file should be renamed with a .pacsave
           extension.

       -s, --recursive
           Remove each target specified including all of their
           dependencies, provided that (A) they are not required by other
           packages; and (B) they were not explicitly installed by the
           user. This operation is recursive and analogous to a backwards
           --sync operation, and it helps keep a clean system without
           orphans. If you want to omit condition (B), pass this option
           twice.

       -u, --unneeded
           Removes targets that are not required by any other packages.
           This is mostly useful when removing a group without using the
           -c option, to avoid breaking any dependencies.

In the example case of libreoffice you could add the –cascade to remove installed language-pack(s) - be sure to check the transaction shown before you press Enter ( :dragon: )

sudo pacman -R --recursive --cascade --unneeded libreoffice-still

Cascade is really “dragons ahead”. Can wipe half of the system if used careless. I wouldn’t do it i was someone struggling to uninstall a package with the gui.

Which is why it carries the warning in the documentation - and the added dragon’s lair - I have also checked - for this particular use case - libreoffice-still - the command only removes what you think it removes.

But as it said in documentation - it is recursive and must be used with care.

@teo has the main answer.

Don’t run pamac-manager and pacman at the same time.

If pamac-manager is running when a removal is done by pacman, restart pamac-manager. If you don’t, the package may look like it is still present/installed but if you apply the remove, you’ll get a "target not found’.

In addition to other responses above, here are a couple of things I do.

pacman -Q <pkg> will tell you if something is installed or not, but you can always double-check using:

# Does the file exist.
# The location of installed packages (99.9% of the time never manually modify)
find  /var/lib/pacman/local -iname 'libreoffice*'

To find any other application files, try findand/or locate. Note, your desktop may have something already installed that indexes files on your system.

# Find files in your home directory that contain the pattern
# Most config files are in hidden directories, $HOME/.<name> or $HOME/.config/<name>
# There may also be files in .cache, .local/share/.
find $HOME -iname '*libreoffice*'

# List file names that match the pattern
locate 'libreoffice' 

# List current timers
systemctl list-timers

# View contents of service and timer to see what and when
systemctl cat updatedb.{service,timer}

locate is part of the package mlocate. A systemd timer, updatedb.service, runs to keep a static version of the files on your system. find, on the other hand, transverses the file system live.

File locations are mostly based on the freedesktop.org XDG standards and the Filesystem Hierarchy Standard.