You are not logged in.

#1 2009-09-27 21:10:44

SomeGuyDude
Member
Registered: 2008-10-09
Posts: 271

Rankmirrors: permission denied?

[crew@myhost pacman.d]$ cd /etc/pacman.d
[crew@myhost pacman.d]$ sudo cp mirrorlist mirrorlist.backup
[crew@myhost pacman.d]$ sudo rankmirrors -n 6 mirrorlist.backup > mirrorlist
-bash: mirrorlist: Permission denied
[crew@myhost pacman.d]$

I can't seem to fix this.


And in the midst of such perfection,
I can't help but feel diseased.

Offline

#2 2009-09-27 21:30:59

Raffles10
Member
From: London, UK
Registered: 2009-05-09
Posts: 115

Re: Rankmirrors: permission denied?

Same results when using 'sudo', but works when using root proper 'su'.

Offline

#3 2009-09-27 21:41:12

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Rankmirrors: permission denied?

Only rankmirrors is run as root, the redirection is still made by the shell running as user.

A work around is to invoke another shell which will be run as root :
sudo sh -c "rankmirrors -n 6 mirrorlist.backup > mirrorlist"

Or you can just redirect the output to a file where you user can write, e.g. /tmp/mirrorlist, then move it.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#4 2009-09-28 00:33:57

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: Rankmirrors: permission denied?

you can also pipe it to tee:

$ rankmirrors -n 6 mirrorlist.backup | sudo tee mirrorlist

Offline

Board footer

Powered by FluxBB