1.设置sudo
安装docker需要执行sudo -命令
需要非root用户来完成,所以需要将非root具体sudo权限
1)切换root权限
2)更改sudoers文件权限
chmod +w/etc/sudoers
3)进入文件进行sudo用户添加
nano/etc/sudoers
在root ALL =(ALL:ALL)ALL下一行键入
用户名 ALL =(ALL:ALL)ALL
保存退出
4)恢复权限
chmod -w/etc/sudoers
重新进入终端,输入sudo -ls查看是否添加成功。
2.出现不能更新,可能需要更换源(root权限下操作)
更换apt源
nano /etc/apt/sources.list
用#注释掉原来的源
添加源
deb https://mirrors.aliyun.com/debian stable main contrib non-free
deb https://mirrors.aliyun.com/debian stable-updates main contrib non-free
保存,然后 apt-get update 进行更新