You are not logged in.
Pages: 1
Hi everyone!
First post here ![]()
I'm having trouble using pacman with sudo.
If I login as root and do
# pacman -Syuit works as expected, no problems at all.
If I try it with my user account and sudo, it doesn't work, it seems the mirrors are not found and I don't know why.
$ sudo pacman -Syu
:: Synchronizing package databases...
error: failed retrieving file 'core.db.tar.gz' from ftp-stud.hs-esslingen.de : No address record
error: failed to update core (No address record)
error: failed retrieving file 'extra.db.tar.gz' from ftp-stud.hs-esslingen.de : No address record
error: failed to update extra (No address record)
error: failed retrieving file 'community.db.tar.gz' from ftp-stud.hs-esslingen.de : No address record
error: failed to update community (No address record)
error: failed to synchronize any databasesEntry from sudoers file:
flip arch=NOPASSWD: /sbin/shutdown, PASSWD: /usr/bin/pacmanI also tried:
flip ALL=(ALL) ALLBut it makes no difference.
I think I am missing something obvious here. Any ideas?
Cheers!
flip
Last edited by flip (2010-11-23 15:20:00)
Offline
Hi, welcome ![]()
Check your internet connection.
This is not a problem with sudo, as the pacman command would not run at all otherwise. This is either a problem with your internet connection, or the mirror. If your connection is fine then change your mirror (/etc/pacman.d/mirrorlist).
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
I can connect to the internet as normal user and as root.
I am behind a proxy though, maybe that is part of the problem? Proxy environment variables are correctly set in .bash_profile for user and root account.
Offline
Read "man sudoers".... Hints:
Defaults !env_resetor
Defaults env_keep+="HTTP_PROXY"Offline
Thanks!
I just found this thread:
https://bbs.archlinux.org/viewtopic.php?pid=747535
And solved it by putting this in sudoers:
Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY"Everything works fine now, thanks!
Last edited by flip (2010-11-23 15:23:16)
Offline
Wow. This is why I never install sudo ![]()
sudo () {
su -c "$*"
}
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
I use it to pop up a shell with "pacman -Syu" on X startup, so i don't forget to keep my packages up to date, and to be able to just click something to shutdown/reboot. It's quite handy for that ![]()
Hey, your approach is actually nice, I think about not using sudo for updating packages anymore. But if you don't want to type in a password, for shutdown, for example, you still have to use sudo.
Last edited by flip (2010-11-23 15:52:48)
Offline
Well actually, there is a way to either shutdown OR reboot without a password (but not both).
The way I do it is put this in ~/.bashrc (or ~/.xinitrc)
setxkbmap -option terminate:ctrl_alt_bkspAnd then edit the line in /etc/inittab to this:
ca::ctrlaltdel:/sbin/shutdown -t3 -h nowNow, I can control-alt-backspace to quit X server and then control-alt-delete to shutdown...all without a password ![]()
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Wow. This is why I never install sudo
sudo () {
su -c "$*"
}
please be so kind as to explain:
- what this function (?) does?
- Where do I save it?
- How do I use it?
thanks
Offline
Put this somewhere in ~/.bashrc and source it (source ~/.bashrc).
It allows commands to be run as root, without staying logged in as root.
For example:
$ sudo pacman -SyuThis will then prompt for root password and run the command, returning back to the regular user after the command has finished.
You can rename it to anything you like. I just called it sudo because it's my version of sudo. Although you can do the same with:
$ su -c "pacman -Syu"But that's longer to type ![]()
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Although, using that you have to type your password every time...
Offline
True, but I have nimble pianist fingers ![]()
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
Pages: 1