Debian初始化及软件安装

1.更换国内源
sudo vim /etc/apt/sources.list
#添加内容到sources.list文件
sudo apt-get update
# Debian 10 buster

# 中科大源

deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free
deb http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

# deb-src http://mirrors.ustc.edu.cn/debian buster main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

# 官方源

# deb http://deb.debian.org/debian buster main contrib non-free
# deb http://deb.debian.org/debian buster-updates main contrib non-free
# deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free

# deb-src http://deb.debian.org/debian buster main contrib non-free
# deb-src http://deb.debian.org/debian buster-updates main contrib non-free
# deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free

# 网易源

# deb http://mirrors.163.com/debian/ buster main non-free contrib
# deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
# deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
# deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

# deb-src http://mirrors.163.com/debian/ buster main non-free contrib
# deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
# deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
# deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

# 阿里云

# deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
# deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
# deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
# deb http://mirrors.aliyun.com/debian-security buster/updates main

# deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
# deb-src http://mirrors.aliyun.com/debian-security buster/updates main
2.安装Git
sudo apt-get install git
git config --global user.name "填写自己的用户名"               # 配置个人用户名
git config --global user.email "填写自己的邮箱号"              #电子邮件地址
3.安装docker

**01、**安装通过HTTPS添加新存储库所需的软件包:

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2

**02、**使用以下curl命令导入存储库的GPG密钥:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

成功后,命令将返回OK。

**03、**将稳定的Docker APT存储库添加到系统的软件存储库列表中:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

$(lsb_release -cs)将返回Debian发行版的名称。在这种情况下,就是这样buster

**04、**更新apt软件包列表并安装最新版本的Docker CE(Community Edition):

sudo apt update
sudo apt install docker-ce

**05、**安装完成后,Docker服务将自动启动。要验证它输入:

sudo systemctl status docker

输出类似如下:

● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-07-30 20:52:00 GMT; 1min 11s ago
    Docs: https://docs.docker.com
...

06、docker操作.netcore

https://www.cnblogs.com/songl/p/11128012.html

4.安装Jdk
sudo apt-get update
sudo apt-get install default-jdk
5.安装Tomcat

01.新建目录 /usr/local/server/

sudo mkdir /usr/local/server/

02.下载tomcat文件放到/usr/local/server/文件夹

03.安装zip解压并解压

sudo apt-get install zip
sudo unzip -o -d /path filename.zip #-o 不提示 -d 指定文件夹

04.开放端口

iptables -I INPUT -p tcp --dport 8080 -j ACCEPT  # linux iptables开放端口命令

05.启动/关闭

./startup.sh
./shutdown.sh

你可能感兴趣的:(部署,docker,git,linux)