1、源是什么
源 : 就是Linux中的应用市场 Linux通过 apt-get 的方式去链接"源" 就可以去源所在的目录下载软件。
2、为啥要还源
由于源是存放在网络中的,可以因为你的地区、网络等问题,导致这个源不可以用。
常用的源有:清华源、北大源、阿里源等;下面是清华源。
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
3、还源的操作步骤
1、复制原本的源文件 作为备份。
2、将已经有源的文件放入到etc/apt路径下。
3、更新源 。
3.1、实际操作
1、复制原本的源 作为备份。
# 1.1 进入到目录下
student@student-machine:~$ cd /etc/apt/
# 1.2 查看是否有 sources.list 文件
student@student-machine:/etc/apt$ ls -l sources.list
-rw-rw-r-- 1 root root 3009 1月 13 2018 sources.list
# 1.3 备份原有的源
student@student-machine:/etc/apt$ sudo cp sources.list sources.list_copy
# 查看是否备份成功
student@student-machine:/etc/apt$ ls -l sources*
-rw-rw-r-- 1 root root 3009 1月 13 2018 sources.list
-rw-r--r-- 1 root root 3009 3月 4 09:51 sources.list_copy
2、将新的源放入到 etc/apt/ 路径下。
获取源,可以通过清华源 网站去获取源。
网站
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
修改源的系统版本
在Windows 中建立一个文本,命名为sources.list。
把刚刚获取的源粘贴 并保存。
将文件放入到 共享文件夹 或者直接拖入 ubuntu
将桌面的sources.list 放入到 etc/apt 目录下
# 将原本的删除
student@student-machine:/etc/apt$ sudo rm sources.list
# 复制文件
student@student-machine:/etc/apt$ sudo cp /home/student/桌面/sources.list ./
# 查看文件是否存在
student@student-machine:/etc/apt$ ls -l sources.list
-rwxr--r-- 1 root root 1261 3月 4 10:01 sources.list
更新源
student@student-machine:/etc/apt$ sudo apt-get update
更换成功后的样式