Press "Enter" to skip to content

Ubuntu系统初始化

#!/bin/bash
#安装numix源
add-apt-repository ppa:numix/ppa -y
#安装java jdk
add-apt-repository ppa:webupd8team/java -y
#为知笔记
add-apt-repository ppa:wiznote-team -y
#percona软件
curl https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
#系统更新
apt update
apt dist-upgrade -y

#安装需要功能
apt install -y tasksel vym retext wireshark geany geany-plugins 
apt install -y filezilla unzip unrar p7zip-full
apt install -y fonts-droid-fallback fonts-dejavu* fonts-wqy-* fonts-arphic-uming
apt install -y vsftpd git apache2 php7.0
apt install -y dkms gdebi wiznote
apt install -y oracle-java8-installer oracle-java8-set-default

#美化
apt install -y numix-icon-theme numix-gtk-theme numix-folders numix-icon-theme-circle unity-tweak-tool

#编程所需
apt install -y build-essential gcc g++ automake make autoconf htop vim curl git wget lftp tasksel net-tools ctags
apt install -y python2.7 python2.7-dev python-pip
apt install -y python-easygui python-pygame python-tk python-pyqt5 
apt install -y python-nmap nmap python-numpy mycli
curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc
pip install pip --upgrade

#配置中文化
apt install -y hunspell-en-za hunspell-en-ca hunspell-en-au
apt install -y language-pack-zh-hans libreoffice-help-zh-cn mythes-en-au fcitx-frontend-qt4 libreoffice-l10n-en-gb libreoffice-l10n-zh-cn  libreoffice-help-en-gb thunderbird-locale-en-gb thunderbird-locale-zh-hans libreoffice-l10n-en-za firefox-locale-zh-hans language-pack-gnome-zh-hans thunderbird-locale-zh-cn
apt install -y fcitx-ui-qimpanel fcitx-sunpinyin  fcitx-table-wubi   fcitx-frontend-qt5  hyphen-en-gb fcitx-ui-classic hunspell-en-gb fcitx-module-cloudpinyin fonts-arphic-ukai fcitx fcitx-frontend-gtk3 fcitx-frontend-gtk2  fcitx-pinyin fcitx-libs

#安装服务功能
tasksel install openssh-server
tasksel install basic-ubuntu-server

#安装数据库
MYSQL_PASSWORD=123456
echo "mysql-server-5.7 mysql-server/root_password password ${MYSQL_PASSWORD}
mysql-server-5.7 mysql-server/root_password seen true
mysql-server-5.7 mysql-server/root_password_again password ${MYSQL_PASSWORD}
mysql-server-5.7 mysql-server/root_password_again seen true
" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt install -y --force-yes mysql-server

#配置httpd功能
tasksel install lamp-server
a2enmod deflate rewrite headers expires
apt install -y libapache2-mod-wsgi
service apache2 restart
#apt install -y phpmyadmin

#设置wireshark普通用户启动
chgrp wireshark /usr/bin/dumpcap
chmod 4755 /usr/bin/dumpcap
gpasswd -a $(whomai) wireshark

#虚拟化配置
tasksel install virt-host
apt -y install qemu-kvm libvirt-bin virtinst bridge-utils 
apt -y install libosinfo-bin libguestfs-tools virt-top 
modprobe vhost_net 
apt -y install virt-manager iotop 

#升级系统配置

ldconfig
updatedb
sync

#防火墙配置
ufw enable
service ufw start
ufw allow ssh
ufw allow http
ufw allow https
ufw allow ftp
ufw allow ftps
ufw reload
ufw status
sync
reboot