Ubuntu configuration + shell after installation

Generally, after installing Ubuntu, you will not use it directly. You will first download some software, and even configure the desktop to be more beautiful. Originally this blog should have nothing to write, but recently learned to use the shell, and found that using the shell to configure Ubuntu is much more effective; The specific idea is that I first write the commands needed in the configuration process to the shell script, and then run the shell script to complete the configuration work at once; for the first configuration, there is no difference, but, who knows himself When do you want to reinstall the system, with this shell script, the next time you configure the system to run this shell script directly, it is much more convenient.

First create a shelll script

touch Init.sh
sudo chmod +x Init.sh

Then add the following content in the shell script Init.sh

#替换阿里源
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
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" > sources.list
cp /etc/apt/sources.list /etc/apt/sources.list.bak
cp sources.list /etc/apt/sources.list
apt update
#-y使得升级软件时不用询问,直接yes,下面也是
apt -y upgrade
#音量控制工具
apt install -y pavucontrol
#媒体播放工具
apt install -y vlc
#解压软件
apt install -y unrar
#压缩软件
apt install -y rar
#C语言编译器
apt install -y gcc
#C++编译器
apt install -y g++
#启动盘创建器
apt install -y usb-creator-gtk
#分布式版本管理工具
apt install -y git
#go语言编译器
apt install -y golang-go
#pip下载工具
apt install -y python-pip
#强大的vim编辑器
apt install -y vim
apt install -y vim-gnome
#配置vim
echo "set ai
set aw
set flash
set ic
set nu
set number
set showmatch
set showmode
set showcmd
set warn
set ws
set wrap
filetype plugin on
set autoindent
set cindent
set noignorecase
set ruler
set scrolloff=5
set shiftwidth=4
set softtabstop=4
set tabstop=4
set wrap
syntax enable
syntax on
set autoindent
set smartindent
set mouse=a
set lines=24 columns=80
set helplang=cn
set guifont=Monospace\ 10
set showtabline=2" > vimrc
cp /etc/vim/vimrc /etc/vim/vimrc.bak
cp vimrc /etc/vim/vimrc
#安装flash插件
tar zxvf fujian/flash.tar.gz -C fujian/flash
cp fujian/flash/libflashplayer.so /usr/lib/mozilla/plugins/
cp -r fujian/flash/usr/* /usr
rm -r fujian/flash
#下载deb安装工具
apt install -y gdebi
#安装WPS,--n参数使得在安装过程中不会询问,下面也是
gdebi fujian/WPS.deb --n
#安装metasploit
gdebi fujian/msf.deb --n
#安装网易云音乐
gdebi fujian/NetEase.deb --n
#安装百度网盘
gdebi fujian/baidudisk.deb --n
#安装google
gdebi fujian/google.deb --n
#安装Java
gdebi fujian/java.deb --n

Before running the shell script, we create a new fujian folder in the parent directory of the shell script, which stores the flash plugin compression package that the shell script depends on and some software deb installation packages, which can be downloaded by yourself (flash plugin .tar.gz compression Package, WPS deb package, metasploit deb package, NetEase cloud music deb package, Baidu network disk deb package, google deb package, Java deb package and renamed to flash.tar.gz, WPS.deb, msf.deb, NetEase. deb, baidudisk.deb, google.deb, java.deb), or directly use the link I organized: https://pan.baidu.com/s/1ev01sfInukJFgUvTqqiYwg Password: jvta

Then run the script

sudo ./Init.sh

Summary: When I first installed Ubuntu for configuration, I manually entered commands in the terminal and operated it bit by bit. I did n’t understand the shell at the time. After understanding the shell, I found that it can significantly improve our work efficiency; in my opinion . The above is just an application of shell scripts. When we work, sometimes we need to think about whether we can use some tools to improve our work efficiency.

Published 9 original articles · liked 0 · visits 122

Guess you like

Origin blog.csdn.net/ckm1607011/article/details/105468065