换源
root@firefly:~# cat /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
查看软件包
sudo apt list --installed
查看存在版本
apt-cache madison openjdk-8-jdk
卸载软件包
sudo apt remove package_name
保留软件不升级
sudo apt-mark hold openjdk-8-jre-headless
卸载软件包(包含文件)
重启网络
/etc/init.d/networking restart
同步时间
apt-get install -y ntpd #安装
vim /etc/ntp.conf #添加下面一行
server cn.pool.ntp.org
/etc/init.d/ntp restart #重启