Java教程

2021年Ubuntu16.04最全安装(配置,更换源)

本文主要是介绍2021年Ubuntu16.04最全安装(配置,更换源),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.ctrl+alt+t,打开终端,设置root用户的初始密码

sudo passwd

2.卸载不需要的软件

  • 卸载LibreOffice
sudo apt-get remove libreoffice-common
  • 删除Amazon广告图标
sudo rm -f /usr/share/applications/com.canonical.launcher.amazon.desktop
sudo rm -f /usr/share/applications/ubuntu-amazon-default.desktop
  • 其他软件
sudo apt-get -y purge thunderbird*#邮件sudo apt-get -y purge firefox#火狐浏览器sudo apt-get -y purge deja-dup#备份sudo apt-get -y purge simple-scan#扫描sudo apt-get -y purge hplip* #打印sudo apt-get -y purge printer-driver* #打印驱动sudo apt-get -y purge rhythmbox* #音乐播放sudo apt-get -y purge gedit* #文本编辑sudo apt-get -y purge libreoffice* #办公套件sudo apt-get -y purge gnome-orca #屏幕阅读sudo apt-get -y purge onboard #屏幕键盘sudo apt-get -y purge mahjongg #对对碰sudo apt-get -y purge aisleriot #纸牌王sudo apt-get -y purge gnome-sudoku #数独sudo apt-get -y purge gnomine #扫雷sudo apt-get -y purge wodim #命令刻碟

3.国内源(能fq就不用改)

  • 备份原始源文件source.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  • 终端执行命令,更改文件权限使其可编辑
sudo chmod 777 /etc/apt/sources.list   
  • 打开文件进行编辑
sudo gedit /etc/apt/sources.list
  • 删除原来的文件内容,复制下面阿里源并保存

1

2

3

4

5

6

7

8

9

10

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

 

4.基础环境

#安装Vim文本编译器(卸载系统自带的Vim-tiny,重新安装)

sudo apt-get remove vim-common

sudo apt-get install vim

#python 3.5(将默认的python2.5升级到3.5)

sudo rm  /usr/bin/python

sudo ln -s /usr/bin/python /usr/bin/python

#安装java

sudo apt-get install oracle-java8-installer

【error fixed】E: Package 'oracle-java8-installer' has no installation candidate

原因:没有该软件的ppa源

sudo add-apt-repository ppa:ts.sch.gr/ppa
sudo apt-get update
sudo apt-get install oracle-java8-installer

# 安装 mysql

sudo apt-get install mysql-server

# 安装phpmyadmin

sudo apt-get install phpmyadmin

# 添加软连接

sudo ln -s /usr/share/phpmyadmin /var/www/

# 安装php7.2

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.2
sudo apt-get -y  install php7.2-fpm php7.2-mysql php7.2-curl php7.2-json php7.2-mbstring php7.2-xml  php7.2-intl

# 安装 composer 

wget https://getcomposer.org/composer.phar
mv composer.phar composer
chmod +x composer
sudo mv composer /usr/local/bin 

# 安装nginx

sudo apt-get update
sudo apt-get install nginx

# 安装nodejs

sudo apt update
sudo apt install nodejs
sudo apt install npm 

# 使用n来管理node版本

/**
* sudo n lts 长期支持
* sudo n stable 稳定版
* sudo n latest 最新版
* sudo n 8.4.0 直接指定版本下载
*/
sudo npm install -g n

# 升级npm

sudo npm i -g npm

 

这篇关于2021年Ubuntu16.04最全安装(配置,更换源)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!