I'm new to linux and am trying to run a set of bash commands in sequential order using a sh file.
This is my sh file :
Code: Select all
#!/bin/bash
apt update;
apt -y install apt-transport-https ca-certificates curl;
gnupg2 software-properties-common;
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -;
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable";
apt update;
apt -y install docker-ce docker-ce-cli containerd.io < "/dev/null";
usermod -aG docker $USER;
newgrp docker;
apt-get install ufw;
ufw allow 22;
ufw allow 80;
ufw allow 443;
ufw enable;
apt-get install nginx;
apt-get update;
apt-get install software-properties-common;
add-apt-repository universe;
add-apt-repository ppa:certbot/certbot;
apt-get update;
apt-get install certbot python-certbot-nginx;
Code: Select all
apt -y install docker-ce docker-ce-cli containerd.io < "/dev/null";
This is my output :
Code: Select all
root@scw-peaceful-poitras:~# chmod +x prepvps.sh
root@scw-peaceful-poitras:~# sudo ./prepvps.sh
Hit:1 http://security.debian.org buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Hit:4 http://deb.debian.org/debian buster-backports InRelease
Hit:5 http://ppa.launchpad.net/scaleway/stable/ubuntu bionic InRelease
Hit:6 https://download.docker.com/linux/debian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.8.2).
ca-certificates is already the newest version (20190110).
curl is already the newest version (7.64.0-4).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
./prepvps.sh: line 4: gnupg2: command not found
OK
Hit:1 http://security.debian.org buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Hit:4 http://deb.debian.org/debian buster-backports InRelease
Hit:5 http://ppa.launchpad.net/scaleway/stable/ubuntu bionic InRelease
Hit:6 https://download.docker.com/linux/debian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
containerd.io is already the newest version (1.2.10-3).
docker-ce-cli is already the newest version (5:19.03.5~3-0~debian-buster).
docker-ce is already the newest version (5:19.03.5~3-0~debian-buster).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
root@scw-peaceful-poitras:~#