|  
도움말

GoDaddy 도움말

How to set up a yum repository on CentOS 6

Do you maintain a bank of servers that all need a common set of RPM packages when initially configured? You can maintain a local Yellowdog Updater, Modified (YUM) repository with the latest releases and speed up installations by not having to go to the public Internet to fetch the latest packages. Once configured and mounted, each new server then just fetches the necessary RPM packages from the locally configured repository.

DIFFICULTY Basic - 1 | Medium - 2 | Advanced - 3
TIME REQUIRED 20 min
RELATED PRODUCTS CentOS-based VPS or dedicated servers

For starters, you need to install the createrepo package as root.

sudo yum install createrepo

You'll be shown a list of packages to install, including any dependencies. When prompted with:

Is this ok [y/N]:

answer with a 'y' (without the quotes) and press Enter/Carriage return.

You'll see the previously listed packages installed.

Once you have createrepo installed, you need to prep the local repository directory (change /myrepo to your desired location):

mkdir /myrepo

Then, place the RPM files to cache into that directory (replacing files and /myrepo with appropriate names).

cp files /myrepo

The createrepo command needs to create a database of information for the cached files. Change to that directory and run the following createrepo command (use your directory name instead of /myrepo):

cd /myrepo
createrepo --database /myrepo

Lastly, you need to create the YUM repository configuration file to reference the local resource. These files are located in /etc/yum.repos.d/. These files must have a .repo extension. Pick your favorite editor if you don't like vi. Pick an appropriate name for the package filename.

cd /etc/yum.repos.d/
vi myrepo.repo

The minimum information necessary is the name to use with the yum command found within square brackets, and the name, baseurl, enabled, and gpgcheck properties. The filename doesn't need to match the name within square brackets, though it is helpful for editing later. And make sure the baseurl points to the right directory. There needs to be three / characters after the file: protocol in the URL.

[myrepo]
name=My Repository
baseurl=file:///myrepo
enabled=1
gpgcheck=0

Save the file and your new repository is all set.


이 글이 도움되었나요?
피드백을 보내주셔서 감사합니다. 고객 서비스 담당자에게 문의하시려면 지원 전화 번호 또는 위의 채팅 옵션을 이용하시기 바랍니다.
도와드릴 수 있어 기쁩니다! 더 도와 드릴 것이 있나요?
그것 유감스럽습니다. 혼동이 되었던 사항 또는 솔루션이 고객님의 문제를 해결하지 못했던 원인을 알려주세요.