在ubuntu下用apt-get install安装软件时,发现package list中没有所需的软件,
估计可能是package list太旧了,于是需要apt-get update & apt-get upgrade。
但又怕原始的源慢,故修改为阿里云镜像。步骤如下:
1、备份原始源的配置文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bakcup
2、添加阿里云源到sources.list文件:
sudo vim /etc/apt/sources.list
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
3、update & upgrade
sudo apt-get update sudo apt-get upgrade
这里,再说一下update 和upgrade的区别:
update命令,会访问源列表里的每个网址,并读取软件列表,然后保存在本地电脑。
upgrade命令,会把本地已安装的软件,与刚下载的软件列表里对应软件进行对比,如果发现已安装的软件版本太低,就会提示你更新。
总而言之,update是更新软件列表,upgrade是更新软件。