---
category: help
layout: help
mirrorid: chef
---

# Chef 软件仓库镜像使用帮助

<form class="form-inline">
<div class="form-group">
	<label>是否使用 HTTPS</label>
	<select id="http-select" class="form-control content-select" data-target="#content-0,#content-1">
	  <option data-http_protocol="https://" selected>是</option>
	  <option data-http_protocol="http://">否</option>
	</select>
</div>
</form>


<form class="form-inline">
<div class="form-group">
	<label>是否使用 sudo</label>
	<select id="sudo-select" class="form-control content-select" data-target="#content-0,#content-1">
	  <option data-sudo="sudo " selected>是</option>
	  <option data-sudo="">否</option>
	</select>
</div>
</form>



Chef 是一套自动化运维工具。

### Debian/Ubuntu 用户

再选择你的 Debian/Ubuntu 版本，文本框中内容写进 `/etc/apt/sources.list.d/chef.list`



<form class="form-inline">
<div class="form-group">
  <label>Ubuntu/Debian 版本：</label>
    <select id="select-0-0" class="form-control content-select" data-target="#content-0">
      <option data-release_name="focal" selected>Ubuntu 20.04 LTS</option>
      <option data-release_name="bionic">Ubuntu 18.04 LTS</option>
      <option data-release_name="xenial">Ubuntu 16.04 LTS</option>
      <option data-release_name="trusty">Ubuntu 14.04 LTS</option>
      <option data-release_name="bullseye">Debian 11 (bullseye)</option>
      <option data-release_name="buster">Debian 10 (buster)</option>
      <option data-release_name="stretch">Debian 9 (stretch)</option>
      <option data-release_name="jessie">Debian 8 (jessie)</option>
    </select>
</div>
</form>

{% raw %}
<script id="template-0" type="x-tmpl-markup">
deb {{http_protocol}}{{mirror}}/apt/stable {{release_name}} main
</script>
{% endraw %}

<p></p>

<pre>
<code id="content-0" data-template="#template-0" data-select="#http-select,#sudo-select,#select-0-0">
</code>
</pre>



### RHEL/CentOS 用户

新建 `/etc/yum.repos.d/chef.repo`，内容为：



{% raw %}
<script id="template-1" type="x-tmpl-markup">
[chef-stable]
name=chef-stable
baseurl={{http_protocol}}{{mirror}}/yum/stable/stable-el$releasever-x86_64/
enabled=1
gpgcheck=1
gpgkey=https://packages.chef.io/chef.asc
</script>
{% endraw %}

<p></p>

<pre>
<code id="content-1" data-template="#template-1" data-select="#http-select,#sudo-select">
</code>
</pre>


