You are not logged in.

#1 2021-02-01 21:23:43

fstabme
Member
Registered: 2020-10-05
Posts: 11

Can't delete package using pacman -R

Hi all,

I am trying to remove a package (onedrive-abraunegg ) from my arch install to reinstall it but I can't seem to do so.

I get the error:

[user@user]$ sudo pacman -R onedrive-abraunegg
error: target not found: onedrive-abraunegg

Trying to download it via git to update it gives me the following error:

[user@user onedrive-abraunegg]$ makepkg -si
==> WARNING: A package has already been built, installing existing package...
==> Installing package onedrive-abraunegg with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) onedrive-abraunegg-2.4.9-1

Total Installed Size:  4.76 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 transaction (conflicting files)
onedrive-abraunegg: /usr/lib/systemd/system/onedrive@.service exists in filesystem
onedrive-abraunegg: /usr/lib/systemd/user/onedrive.service exists in filesystem
Errors occurred, no packages were upgraded.
==> WARNING: Failed to install built package(s).

Why can't I update or remove this app?

Last edited by fstabme (2021-02-01 21:24:03)

Offline

#2 2021-02-01 21:31:45

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: Can't delete package using pacman -R

What is the output of:

pacman -Qo /usr/lib/systemd/user/onedrive.service

You can not remove a package that is not installed.  What is the output of:

pacman -Qi onedrive-abraunegg

Offline

#3 2021-02-01 21:39:04

fstabme
Member
Registered: 2020-10-05
Posts: 11

Re: Can't delete package using pacman -R

I may have done something stupid, I deleted the files in :

/usr/lib/systemd/system/onedrive@.service exists in filesystem
/usr/lib/systemd/user/onedrive.service exists in filesystem

using sudo rm.

This allowed me to makepkg -si install the newer version of onedrive-abraunegg

and pacman confirms this is the version installed:

[user@user onedrive-abraunegg]$ makepkg -si
==> WARNING: A package has already been built, installing existing package...
==> Installing package onedrive-abraunegg with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) onedrive-abraunegg-2.4.9-1

Total Installed Size:  4.76 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%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) installing onedrive-abraunegg                [######################] 100%
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
(2/2) Arming ConditionNeedsUpdate...
[user@user onedrive-abraunegg]$ sudo pacman -R onedrive-abraunegg
checking dependencies...

Packages (1) onedrive-abraunegg-2.4.9-1

Total Removed Size:  4.76 MiB

:: Do you want to remove these packages? [Y/n] 

however, the version running off the command line is still the old version that I can't seem to delete?

[user@user onedrive-abraunegg]$ onedrive --version
onedrive v2.4.5-22-ge44e6b4

Is there a way to find out where the command onedrive in terminal links to ? And where to find this phantom package/delete it?

thanks!

Offline

#4 2021-02-01 21:40:29

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: Can't delete package using pacman -R

type -a onedrive

Offline

#5 2021-02-01 21:43:13

fstabme
Member
Registered: 2020-10-05
Posts: 11

Re: Can't delete package using pacman -R

I removed the new version to avoid confusion, since i'm trying to get rid of this phantom old version

I get this:

type -a onedrive
onedrive is /usr/local/bin/onedrive

Is there a way to uninstall this old version?

also :

pacman -Qo onedrive
error: No package owns /usr/local/bin/onedrive

pacman -Qo returns the above

Last edited by fstabme (2021-02-01 21:49:19)

Offline

#6 2021-02-01 21:57:25

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: Can't delete package using pacman -R

If you do not know where the source you built the old version is (with which you could try # make uninstall) then you need to manually remove the files from /usr/local so it looks as below:

find /usr/local/
/usr/local/
/usr/local/lib
/usr/local/man
/usr/local/src
/usr/local/games
/usr/local/etc
/usr/local/sbin
/usr/local/include
/usr/local/bin
/usr/local/share
/usr/local/share/man

Offline

#7 2021-02-01 22:07:36

fstabme
Member
Registered: 2020-10-05
Posts: 11

Re: Can't delete package using pacman -R

Thanks, doing that has removed the old version, now onedrive command does nothing.

and the find command renders the following:

find /usr/local/
/usr/local/
/usr/local/man
/usr/local/src
/usr/local/include
/usr/local/etc
/usr/local/games
/usr/local/share
/usr/local/share/man
/usr/local/bin
/usr/local/sbin
/usr/local/lib

Now installing a fresh copy via makepkg works fine, however typing the command "onedrive" after install renders nothing:

[user@user onedrive-abraunegg]$ makepkg -si
==> WARNING: A package has already been built, installing existing package...
==> Installing package onedrive-abraunegg with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) onedrive-abraunegg-2.4.9-1

Total Installed Size:  4.76 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%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) installing onedrive-abraunegg                [######################] 100%
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
(2/2) Arming ConditionNeedsUpdate...
[user@user onedrive-abraunegg]$ onedrive --version
bash: /usr/local/bin/onedrive: No such file or directory

Last edited by fstabme (2021-02-01 22:08:22)

Offline

#8 2021-02-01 22:27:01

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: Can't delete package using pacman -R

The path to the old location is still remembered by the shell,  one of the following should resolve the issue:

hash -d onedrive

Delete the hash,  it will be rehashed on next execution.

hash -p /usr/bin/onedrive onedrive

Set the correct path for the executable.

Offline

#9 2021-02-01 22:29:16

fstabme
Member
Registered: 2020-10-05
Posts: 11

Re: Can't delete package using pacman -R

Holy balls. Thank you.

I owe you a beer.

Time for me to go read about the functions i've learnt from this problem.

Offline

#10 2021-02-01 22:42:02

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Can't delete package using pacman -R

The cause of your problem is that you originally didn't use pacman to install onedrive-abraunegg, thus you couldn't then uninstall it using pacman.

This also prevented you from installing it using pacman as your manual installation created files which conflicted with the package.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB