Ubuntu
#Linux
https://news.mynavi.jp/techplus/article/20190222-775519/
grep "install" /var/log/apt/history.log
直近でインストールされたパッケージリストを表示
---
サーバーセットアップ
code:sh
sudo timedatectl set-timezone Asia/Tokyo
sudo localectl set-locale LANG=en_US.UTF-8
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y wget neovim tmux git nmap htop docker docker-compose
full-upgradeはサーバーではしないほうが良いか
caddy
https://caddyserver.com/docs/install
code:sh
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
OIDC入れるならApacheだったか
https://eiwg.openid.or.jp/phase3/samples/implementation/mod_auth_openidc
code:setup.sh
#!/bin/bash
sudo timedatectl set-timezone Asia/Tokyo
sudo localectl set-locale LANG=en_US.UTF-8
sudo apt-get update -y
sudo apt-get upgrade -y
# sudo apt-get full-upgrade -y
sudo apt-get install -y wget neovim tmux git nmap htop # docker docker-compose
sudo curl -L https://nixos.org/nix/install | sh
wget https://raw.githubusercontent.com/ttaki/nix-shell/master/cmd.nix
curl https://raw.githubusercontent.com/ttaki/dotfiles-shell/master/sample/setup.sh | bash
curl -sLf https://spacevim.org/install.sh | bash -s -- --uninstall
# sudo apt install bat exa fzf git htop neofech neovim vim ranger tmux zsh fd ripgrep
apt man ページ
https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_basic_package_management_operations
full-upgrade
https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_basic_package_management_operations
シェルスクリプトではapt-getを使用する。
Users are recommended to use the new apt(8) command for interactive usage and use the apt-get(8) and apt-cache(8) commands in the shell script.
ppa
Personal Package Archive
-------
nginx
digitalocean blog
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
再起動が必要かどうか調べるには
https://www.debian.org/doc/debian-policy/ch-opersys.html#signaling-that-a-reboot-is-required
ls /var/run/reboot-required
ファイルがあれば、再起動が必要
cat /var/run/reboot-required.pkgs
再起動が必要な理由を確認
apt man
https://manpages.debian.org/stretch/apt/apt.8.ja.html
purgeは設定ファイルも削除する
apt purge
依存関係が無く、不要なパッケージを削除する
sudo apt autoremove