换成国内源
备份原有的源配置文件
cp /etc/apt/sources.list /etc/apt/sources.listbak删除该源配置文件
rm -f /etc/apt/sources.list生成国内的源配置文件
echo "deb http://ftp.cn.debian.org/debian/ stretch main" > /etc/apt/sources.list echo "deb http://ftp.cn.debian.org/debian/ stretch-updates main" >> /etc/apt/sources.list echo "deb http://ftp.cn.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list更新源
apt-get update
安装常用软件
curl
apt-get install curlwget
apt-get install wgetvim
apt-get install vimjdk
apt install openjdk-8-jdk
安装jenkins(root权限)
Import the GPG keys of the Jenkins repository
root权限使用
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | apt-key add -非root权限使用
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -add the Jenkins repository to your system
root权限使用sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'非root权限使用
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'Update the
aptpackage list and install the latest version of Jenkins by runningroot权限使用
apt update apt install jenkins非root权限使用
sudo apt update sudo apt install jenkinsStart the Jenkins service and enable it to automatically start on boot
root权限使用
systemctl start jenkins systemctl enable jenkins非root权限使用
sudo systemctl start jenkins sudo systemctl enable jenkins