You are not logged in.

#1 2012-01-21 18:58:55

Lexworth
Member
Registered: 2012-01-19
Posts: 36

[Solved]How to remove files from a failed install.

I attempted to install the caffeine package from the AUR using packer. After confirming y to proceed with installation pacman had to pull in quite a few more dependencies than I was expecting. The installation ended up failing because I have package signing set to required. This is all well and good because I don't really think caffeine is worth all the extra dependencies. However, on to my question, I see that these packages (the dependencies) have been downloaded to my system and are in the /var/cache/pacman/pkg directory, is there an easy way to tell pacman to remove just these packages other than going through and removing them one by one? Thanks for the help.

Last edited by Lexworth (2012-01-21 19:19:43)

Offline

#2 2012-01-21 19:01:33

Paulloz
Member
From: Paris, France
Registered: 2012-01-21
Posts: 6
Website

Re: [Solved]How to remove files from a failed install.

Hi,

pacman -Scc

remove all files from pacman's cache wink


Why choose the lesser evil ?
You can follow me on Twitter (beware, it's mostly french).

Offline

#3 2012-01-21 19:01:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [Solved]How to remove files from a failed install.

You have the list of installed packages in your pacman log file, you have bash. I don't think there is anything else you might need.

Offline

#4 2012-01-21 19:05:39

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: [Solved]How to remove files from a failed install.

Try:  sudo pacman -R $(pacman -Qdtq)

Look closely at the list of things it proposes removing.

I leave it as an exercise to the reader to decipher that command by reading man pacman


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2012-01-21 19:10:29

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]How to remove files from a failed install.

@ewaller
Wouldn't e.g. 'pacman -Rns' make more sense than 'pacman -R'?


After you uninstall the packages, run 'pacman -Sc' to get rid of them (and some other unused ones) from the cachedir.

Offline

#6 2012-01-21 19:13:50

Paulloz
Member
From: Paris, France
Registered: 2012-01-21
Posts: 6
Website

Re: [Solved]How to remove files from a failed install.

@karol
I think the recursive option -s is useless as packages are already selected by -Qdt.

Last edited by Paulloz (2012-01-21 19:14:15)


Why choose the lesser evil ?
You can follow me on Twitter (beware, it's mostly french).

Offline

#7 2012-01-21 19:17:51

Lexworth
Member
Registered: 2012-01-19
Posts: 36

Re: [Solved]How to remove files from a failed install.

Thanks to you all. I did read pacman manpage as well as the wiki entries for pacman and pacman Tips. I was just wondering if maybe someone more proficient with the command line knew a easier way to remove the files. I know I could use pacman -Sc or pacman -Scc for clean the entire cache but was hesitant to do so because of the warnings. I think I understand that sudo pacman -R $(pacman -Qtdq) will remove orphan packages however I get an error that no targets are specified. I believe this may be due to the fact that these packages were not installed, just the binaries downloaded. Thanks again for the help. I'll mark this as solved.

Offline

#8 2012-01-21 19:19:06

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]How to remove files from a failed install.

Paulloz wrote:

@karol
I think the recursive option -s is useless as packages are already selected by -Qdt.

They may depend on some other packages.

Let's say 'pacman -Qdt' returns package A.
Package A needs packages B and C. Neither B nor C is needed by any other package. If you remove just A, B and C will remain and you will have to run 'pacman -Qdt' again to spot this.

Last edited by karol (2012-01-21 19:19:28)

Offline

#9 2012-01-21 19:19:37

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: [Solved]How to remove files from a failed install.

karol wrote:

@ewaller
Wouldn't e.g. 'pacman -Rns' make more sense than 'pacman -R'?

Not quite.  That command requires a target, then the target, plus all its dependencies are removed (provided those dependencies are not used elsewhere)

My command does not require a target, it just looks for all the orphans on the system.
The OP stated that he never managed to get the target installed.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2012-01-21 19:21:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]How to remove files from a failed install.

No, I meant

sudo pacman -Rns $(pacman -Qdtq)

instead of

sudo pacman -R $(pacman -Qdtq)

Offline

#11 2012-01-21 19:23:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: [Solved]How to remove files from a failed install.

karol wrote:

No, I meant

sudo pacman -Rns $(pacman -Qdtq)

instead of

sudo pacman -R $(pacman -Qdtq)

Oh.  Got it  smile


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#12 2012-01-21 19:24:24

Paulloz
Member
From: Paris, France
Registered: 2012-01-21
Posts: 6
Website

Re: [Solved]How to remove files from a failed install.

karol wrote:
Paulloz wrote:

@karol
I think the recursive option -s is useless as packages are already selected by -Qdt.

They may depend on some other packages.

Let's say 'pacman -Qdt' returns package A.
Package A needs packages B and C. Neither B nor C is needed by any other package. If you remove just A, B and C will remain and you will have to run 'pacman -Qdt' again to spot this.

Yes, I haven't thought about it.


Why choose the lesser evil ?
You can follow me on Twitter (beware, it's mostly french).

Offline

Board footer

Powered by FluxBB