Advertisement
itnetsec

Modifying CentOS repository with GoDaddy virtual hosting

Nov 17th, 2011
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. #Written by: Michael Wood
  2. #Date 11-17-2011
  3.  
  4. By default GoDaddy uses its on repositories. Downside to this is,
  5. they don't keep them updated - not by a long shot. I would check for
  6. updates and realize nothing was being pulled down. So, I pulled out
  7. the trusty ol' vi editor and checked out the file
  8. /etc/yum.repos.d/CentOS-Base.repo
  9.  
  10. Looking at the file, the two sections we are going to be editing are
  11. (Make a backup copy first! cp CentOS-Base.repo CentOS-Base.repo.bak):
  12.  
  13. [base]
  14. name=CentOS-5 - Base
  15. mirrorlist=http://s2plmirror01.prod.sdl2.secureserver.net/vph/2/download/mirrors/cos-5.i386
  16. failovermethod=priority
  17. #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  18. gpgcheck=1
  19. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5
  20.  
  21. #released updates
  22. [update]
  23. name=CentOS-5 - Updates
  24. mirrorlist=http://s2plmirror01.prod.sdl2.secureserver.net/vph/2/download/mirrors/cos-5-updates.i386
  25. failovermethod=priority
  26. #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
  27. gpgcheck=1
  28. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5
  29.  
  30.  
  31. In the first section [base] GoDaddy uses its on servers for updates.
  32. In our case it's
  33. "http://s2plmirror01.prod.sdl2.secureserver.net/vph/2/download/mirrors/cos-5.i386"
  34. Trying to browser that URL either timesout or doesn't connect at all.
  35. But if you look below that line you'll see a failover method, BUT the
  36. baseurl for CentOS's main repository mirror has been commented
  37. out...how shady of them.
  38.  
  39. Same goes for #release updates
  40.  
  41. Change the line under [base]:
  42. mirrorlist=http://s2plmirror01.prod.sdl2.secureserver.net/vph/2/download/mirrors/cos-5.i386
  43.  
  44. To:
  45. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  46.  
  47.  
  48. Next, change the same under #released updates, from:
  49. mirrorlist=http://s2plmirror01.prod.sdl2.secureserver.net/vph/2/download/mirrors/cos-5-updates.i386
  50.  
  51. To:
  52. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  53.  
  54.  
  55. So, the end result would be:
  56.  
  57. [base]
  58. name=CentOS-5 - Base
  59. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  60. failovermethod=priority
  61. #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  62. gpgcheck=1
  63. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5
  64.  
  65. #released updates
  66. [update]
  67. name=CentOS-5 - Updates
  68. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  69. failovermethod=priority
  70. #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
  71. gpgcheck=1
  72. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos5
  73.  
  74. Choosing mirrorlist.centos.org will pick the fastest mirror to pull in
  75. updates from. Now run the command "yum update" and you'll notice you
  76. have quite a few outdated packages.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement