一 、宽带拨号上网
1.在设置中关闭有线连接的自动连接。
2.输入终端命令
sudo pppoeconf
按提示输入账号密码,记得删除 username
拨号相关命令
启动:
sudo pon dsl-provider
关闭:
sudo poff dsl-provider
二、 更换软件源
首先打开软件和更新,在ubuntu软件选项选择其他站点,选择清华源,然后更改其他软件的源。
1.备份系统自带的源
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
2.更换源
sudo gedit /etc/apt/sources.list
这里给出阿里源和清华源,校园网用户推荐使用清华源,在打开的文件中插入下面的代码并保存即可。
阿里源:
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
清华源:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
3.更新源
sudo apt-get update
三、更换pip源
cd ~/.pip
如果不存在.pip目录,则创建目录:
mkdir ~/.pip
cd ~/.pip
touch pip.conf
sudo gedit ~/.pip/pip.conf
在pip.conf中写入如下内容,即可(这里用的是清华源):
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
四 、基础工具和依赖库安装
安装gcc:
sudo apt install gcc
安装make:
sudo apt install make
sudo apt install make-guile
安装32位依赖库:
sudo apt-get install lib32ncurses5 lib32z1
安装驱动依赖库:
sudo apt install dkms build-essential linux-headers-generic
五、安装nvidia显卡驱动
1.在nvidia官网https://www.geforce.cn/drivers选择对应型号的驱动下载
2.卸载原先的驱动版本(没装过可以跳过这步)
sudo /usr/bin/nvidia-uninstall
sudo apt-get install autoremove --purge nvidia*
3.禁用nouveau
sudo gedit /etc/modprobe.d/blacklist.conf
在打开的文件末尾加入下两行代码:
blacklist nouveau
options nouveau modeset=0
点击保存,关闭文件
输入命令使代码生效
sudo update-initramfs -u
重启,输入代码检测是否禁用成功,如果输入代码什么都没输出,就说明禁用成功
lsmod | grep nouveau
4.找到下载的驱动文件,重命名为nvidia(主要是后面的步骤比较方便,不重命名也可以),最好复制到home目录下
cd 下载
sudo cp nvidia.run /home
5.关闭图形界面
sudo init 3
6.安装驱动
cd /home
sudo chmod a+x nvidia.run
sudo ./nvidia.run -no-opengl-files
7.按提示安装驱动,完成后输入下面命令查看是否安装成功
nvidia-smi
出现这个界面即代表安装成功。
msi@Msi-GE63:~$ nvidia-smi
Fri Mar 1 14:53:42 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.93 Driver Version: 410.93 CUDA Version: 10.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1060 Off | 00000000:01:00.0 On | N/A |
| N/A 49C P0 25W / N/A | 126MiB / 6078MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1186 G /usr/lib/xorg/Xorg 24MiB |
| 0 1570 G /usr/lib/xorg/Xorg 98MiB |
+-----------------------------------------------------------------------------+
8.安装完后重启
reboot
六、 更改安装双系统,win10下时间错误的bug
在终端输入以下命令:
sudo apt-get install ntpdate
sudo ntpdate time.windows.com
sudo hwclock --localtime --systohc
七、更改grub2引导默认启动项以及启动时间
修改grub文件
sudo gedit /etc/default/grub
打开的文件中,GRUB_DEFAULT=0 #更改数字设置默认启动项,数字编号从0开始,默认启动ubuntu
GRUB_TIMEOUT=10 #更改grub系统选择时间,以秒为单位
保存并更新:
sudo update-grub
八 、安装chrome浏览器
sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.list.d/
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-get update
sudo apt-get install google-chrome-stable