Debian GNU/Linux / Raspbian

Debian GNU/Linux distribution and some devariatives such as Raspbian already have included Salt packages to their repositories. However, current stable release codenamed "Jessie" contains old outdated Salt release. It is recommended to use SaltStack repository for Debian as described below.

Installation from official Debian and Raspbian repositories is described here.

Installation from the SaltStack Repository

2015.5 and later packages for Debian 8 ("Jessie") are available in the SaltStack repository.

注解

SaltStack repository contains only packages suitable for i386 (32-bit Intel-compatible CPUs) and amd64 (64-bit) architectures. While Salt packages are built for all Debian ports (have all suffix in package names), some of the dependencies are avaivable only for amd64 systems.

重要

The repository folder structure changed in the 2015.8.3 release, though the previous repository structure that was documented in 2015.8.1 can continue to be used.

To install using the SaltStack repository:

  1. Run the following command to import the SaltStack repository key:

    wget -O - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
    
  2. Add the following line to /etc/apt/sources.list:

    deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main
    
  3. Run sudo apt-get update.

  4. Now go to the packages installation section.

Installation from the Community Repository

The SaltStack community maintains a Debian repository at debian.saltstack.com. Packages for Debian Old Stable, Stable, and Unstable (Wheezy, Jessie, and Sid) for Salt 0.16 and later are published in this repository.

注解

Packages in this repository are community built, and it can take a little while until the latest SaltStack release is available in this repository.

Jessie (Stable)

For Jessie, the following line is needed in either /etc/apt/sources.list or a file in /etc/apt/sources.list.d:

deb http://debian.saltstack.com/debian jessie-saltstack main

Wheezy (Old Stable)

For Wheezy, the following line is needed in either /etc/apt/sources.list or a file in /etc/apt/sources.list.d:

deb http://debian.saltstack.com/debian wheezy-saltstack main

Squeeze (Old Old Stable)

For Squeeze, you will need to enable the Debian backports repository as well as the debian.saltstack.com repository. To do so, add the following to /etc/apt/sources.list or a file in /etc/apt/sources.list.d:

deb http://debian.saltstack.com/debian squeeze-saltstack main
deb http://backports.debian.org/debian-backports squeeze-backports main

Stretch (Testing)

For Stretch, the following line is needed in either /etc/apt/sources.list or a file in /etc/apt/sources.list.d:

deb http://debian.saltstack.com/debian stretch-saltstack main

Sid (不稳定版)

For Sid, the following line is needed in either /etc/apt/sources.list or a file in /etc/apt/sources.list.d:

deb http://debian.saltstack.com/debian unstable main

Import the repository key

你需要导入密钥用于签名。

wget -q -O- "http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key" | apt-key add -

注解

你也可以通过对比这里显示的公钥签名、使用命令“sha512sum”来验证密钥完整性,例如:

echo "b702969447140d5553e31e9701be13ca11cc0a7ed5fe2b30acb8491567560ee62f834772b5095d735dfcecb2384a5c1a20045f52861c417f50b68dd5ff4660e6  debian-salt-team-joehealy.gpg.key" | sha512sum -c

更新包数据库

apt-get update

Installation from the Debian / Raspbian Official Repository

Stretch (Testing) and Sid (Unstable) distributions are already contain mostly up-to-date Salt packages built by Debian Salt Team. You can install Salt components directly from Debian.

On Jessie (Stable) there is an option to install Salt minion from Stretch with python-tornado dependency from jessie-backports repositories.

To install fresh release of Salt minion on Jessie:

  1. Add jessie-backports and stretch repositories:

    Debian:

    echo 'deb http://httpredir.debian.org/debian jessie-backports main' >> /etc/apt/sources.list
    echo 'deb http://httpredir.debian.org/debian stretch main' >> /etc/apt/sources.list
    

    Raspbian:

    echo 'deb http://archive.raspbian.org/raspbian/ stretch main' >> /etc/apt/sources.list
    
  2. Make Jessie a default release:

    echo 'APT::Default-Release "jessie";' > /etc/apt/apt.conf.d/10apt
    
  3. Install Salt dependencies:

    Debian:

    apt-get update
    apt-get install python-zmq python-tornado/jessie-backports salt-common/stretch
    

    Raspbian:

    apt-get update
    apt-get install python-zmq python-tornado/stretch salt-common/stretch
    
  4. Install Salt minion package from Stretch:

    apt-get install salt-minion/stretch
    

Install Packages

Install the Salt master, minion or other packages from the repository with the apt-get command. These examples each install one of Salt components, but more than one package name may be given at a time:

  • apt-get install salt-api
  • apt-get install salt-cloud
  • apt-get install salt-master
  • apt-get install salt-minion
  • apt-get install salt-ssh
  • apt-get install salt-syndic

安装后的工作

现在, 让我们跳转到 配置Salt 页面.