在一个没有安装vim等命令的Linux环境中,没办法更新数据源,没办法软件的安装等的解决方案:
编辑数据源
vi /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-backports main restricted universe multiverse
更新数据源
apt-get update
针对sources.list文件,可利用echo命令完成写入,然后并更新数据源;如下:
echo deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse > sources.list
echo deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse >> sources.list
echo deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse >> sources.list
echo deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse >> sources.list