灌了ubuntu第一件事,不是更新,是換一個快的mirror
script
#! /bin/bash
new=free.nchc.org.tw
old=$(cat /etc/apt/sources.list | grep main | awk '{ print $2 }' | cut -d'/' -f3 | sed -n '3P')
sudo sed -i "s/$old/$new/g" /etc/apt/sources.list
sudo sed -i "s/security.ubuntu.com/$new/g" /etc/apt/sources.list
sudo apt update
bash的複習: 各種expansion
給個變數
hi=123