Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #206582
| From | deb <deb@rangingthoughts.org> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: apt-cacher errors |
| Date | 2019-03-25 15:10 +0100 |
| Message-ID | <xFysx-7Cf-3@gated-at.bofh.it> (permalink) |
| References | <xFtVT-4Pg-3@gated-at.bofh.it> <xFvEm-5Vy-1@gated-at.bofh.it> <xFwh4-68B-7@gated-at.bofh.it> <xFwTL-6AO-1@gated-at.bofh.it> <xFxPP-79F-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 3/25/19 9:21 AM, Greg Wooledge wrote:
> On Mon, Mar 25, 2019 at 12:11:21PM +0000, Adam Weremczuk wrote:
>> I've found 30 entries referencing wheezy and removed them all:
>>
>> sudo find /var/cache/apt-cacher/ -type f -name *wheezy* | xargs rm
> sudo find /var/cache/apt-cacher -type f -name '*wheezy*' -delete
>
> There are three mistakes in your command:
>
> 1) The glob must be quoted, or the shell will expand it based on the files
> in the current working directory, wherever that happens to be.
>
> 2) xargs without -0 is unsafe to use for filenames, because they may contain
> whitespace or single quotes or double quotes, all of which are special
> to xargs.
>
> 3) You ran find with sudo privileges (probably not necessary), and failed
> to run the rm with sudo privileges. All of the removals are therefore
> going to fail.
>
> You might argue that "apt-cacher never has any files with spaces!"
> That may be true. But it's still a good habit to develop. Also, -delete
> is more efficient than | xargs rm, albeit not portable to POSIX scripts.
>
> If you want it to be portable as well as safe, then:
>
> sudo find /var/cache/apt-cacher -type f -name '*wheezy*' -exec rm {} +
>
> That's less efficient than -delete, but it's the best you can do if
> POSIX portability is required.
>
>
Great thoughts Greg.
Helped me too.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
apt-cacher errors Adam Weremczuk <adamw@matrixscience.com> - 2019-03-25 10:20 +0100
Re: apt-cacher errors Roberto C. Sánchez <roberto@debian.org> - 2019-03-25 12:10 +0100
Re: apt-cacher errors Roberto C. Sánchez <roberto@debian.org> - 2019-03-25 12:50 +0100
Re: apt-cacher errors Adam Weremczuk <adamw@matrixscience.com> - 2019-03-25 13:30 +0100
Re: apt-cacher errors Greg Wooledge <wooledg@eeg.ccf.org> - 2019-03-25 14:30 +0100
Re: apt-cacher errors deb <deb@rangingthoughts.org> - 2019-03-25 15:10 +0100
Re: apt-cacher errors Greg Wooledge <wooledg@eeg.ccf.org> - 2019-03-25 15:30 +0100
Re: apt-cacher errors Adam Weremczuk <adamw@matrixscience.com> - 2019-03-25 15:50 +0100
csiph-web