Sunday, April 22, 2012

Broken Yum (temporary fix)

I went to update my system (Fedora 16) and apparently Yum is broken due to 404 errors for the repository.  See below:

[thenderson@ENAIC yum.repos.d]$ yum update


* Connected to rpm.aegisco.com (107.21.192.53) port 80 (#0)
> GET /aegisco/rhel/16/x86_64/repodata/repomd.xml HTTP/1.1
User-Agent: urlgrabber/3.9.1 yum/3.4.3
Host: rpm.aegisco.com
Accept: */*

* The requested URL returned error: 404
* Closing connection #0
* HTTP response code said error
2012-04-22 15:37:08,046 exception: [Errno 14] HTTP Error 404 - Not Found : http://rpm.aegisco.com/aegisco/rhel/16/x86_64/repodata/repomd.xml
INFO:urlgrabber:exception: [Errno 14] HTTP Error 404 - Not Found : http://rpm.aegisco.com/aegisco/rhel/16/x86_64/repodata/repomd.xml
2012-04-22 15:37:08,046 calling callback: (<bound method YumBaseCli.failureReport of <cli.YumBaseCli object at 0x2201e10>>, (), {})
INFO:urlgrabber:calling callback: (<bound method YumBaseCli.failureReport of <cli.YumBaseCli object at 0x2201e10>>, (), {})
http://rpm.aegisco.com/aegisco/rhel/16/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found : http://rpm.aegisco.com/aegisco/rhel/16/x86_64/repodata/repomd.xml
Trying other mirror.
2012-04-22 15:37:08,047 MIRROR: failed
INFO:urlgrabber:MIRROR: failed
2012-04-22 15:37:08,047 GR   mirrors: [] 0
INFO:urlgrabber:GR   mirrors: [] 0
2012-04-22 15:37:08,047 MAIN mirrors: [http://rpm.aegisco.com/aegisco/rhel/16/x86_64/] 0
INFO:urlgrabber:MAIN mirrors: [http://rpm.aegisco.com/aegisco/rhel/16/x86_64/] 0
Error: failure: repodata/repomd.xml from aegisco: [Errno 256] No more mirrors to try.

From what I can tell this error came about after adding a repository to my /etc/yum.repos.d directory.  The exact repo was:

http://rpm.aegisco.com/aegisco/rhel/16/x86_64/repodata/repomd.xml

So I removed it from yum.repos.d:


[meeky@ENAIC ~]$ cd /etc/yum.repos.d/
[meeky@ENAIC yum.repos.d]$ ls
aegisco.repo  dropbox.repo  fedora.repo  fedora-updates.repo  fedora-updates-testing.repo  google-chrome.repo  rbel6.repo
[meeky@ENAIC yum.repos.d]$ sudo mv aegisco.repo /tmp
[thenderson@ENAIC yum.repos.d]$ yum check-update

If this works correctly you should get a bunch of update notices (if you haven't updated in a while like me)

selinux-policy.noarch                                                   3.10.0-84.fc16                                                        updates
selinux-policy-targeted.noarch                                          3.10.0-84.fc16                                                        updates
shotwell.x86_64                                                         0.10.1-4.fc16                                                         updates
spice-glib.x86_64                                                       0.11-4.fc16                                                           updates
spice-gtk3.x86_64                                                       0.11-4.fc16                                                           updates
system-config-users.noarch                                              1.2.114-1.fc16                                                        updates
tzdata.noarch                                                           2012c-1.fc16                                                          updates
usbredir.x86_64                                                         0.4.3-1.fc16                                                          updates
virtuoso-opensource.x86_64                                              1:6.1.5-2.fc16                                                        updates
[message truncated]


Saturday, April 7, 2012

Fedora 16 :: Adding A User to the Sudoers file

Fedora 16 installs without giving the default user sudo rights...unlike some other Linux distributions, and I needed admin rights to update my system.  I did a little Google search and came across www.mjmwired.net's tutorial for adding a user to the sudoer's file

The tutorial esentially states to change the sudoers fileto write permissions that you can echo  '"user ALL=(ALL) ALL and appened it into the /etc/sudoers file. 

 [thenderson@localhost Documents]$ ls -l /etc/sudoers
-r--r-----. 1 root root 3338 Nov 30  2010 /etc/sudoers
[root@localhost Documents]$ chmod +w /etc/sudoers

[root@localhost Documents]$
[root@localhost Documents]$ echo "user ALL=(ALL) ALL >> /etc/sudoers
[user@localhost Documents]$
[root@localhost Documents]$ su user 
[user@localhost Documents]$ sudo ls /root
[user@localhost Documents]$ Operation not permitted  



Unfortunately this didn't work for me.  As you can see the error "Operation not permitted." So I figured I"d write about a little blurb on how I got this to work in Fedora 16.

Using 'visudo' worked for me.  Here's how simply this was done:

#visudo

** If you need a VI editor cheatsheet click here

At the bottom of the sudoers file enter in your username in the following format

user ALL=(ALL) ALL

 Let's explain this full line

user - pretty self explaintory, this is your username
1st ALL - User can execute as all users
(ALL) - User can act as any user
3d ALL - user can run all commands

Append this line to bottom of /etc/sudoers file users ALL=(ALL) ALL then save the file.  That's it!  Now test it with something like this: 

[user@localhost ~]$ sudo ls /root
anaconda-ks.cfg
[user@localhost ~]$ 


If you get the following, you've done something wrong, so go back and check your syntax:

[user@localhost ~]$ ls /root
ls: cannot open directory /root: Permission denied


Any questions concerns, or critizism let me know.