虚拟机里安装debian9遇到的问题

一、允许root用户登录和以ssh方式登录

1.允许以root用户登录操作系统
默认情况下debian是不允许以root用户登录的,只能以其他用户登录系统中,然后su到root用户下进行操作。
1.1修改vi /etc/gdm3/daemon.conf文件
新增下面一行AllowRoot = true
[security]
AllowRoot = true
1.2修改vi /etc/pam.d/gdm-password
注释掉下面内容
#auth required pam_succeed_if.so user != root quiet_success
然后重启操作系统,就可以使用root用户登录操作系统了。

2.以root身份通过ssh登录操作系统
2.1修改vi /etc/ssh/sshd_config

#PermitRootLogin prohibit-password
修改为PermitRootLogin yes
2.2重启ssh即可
service sshd restart

/etc/init.d/ssh restart
之后就可以以root用户ssh登录了。


二、解决apt-get install  gcc E: 无法定位软件包问题

1. 添加配置镜像源

终端执行sudo vim /etc/apt/sources.list选择下面适合自己的版本的镜像源保存退出后继续下面第2步骤

2. 然后执行更新 sudo apt-get update

3. 接着安装就可以了apt-get install  gcc

三、遇到问题在来添加

debian各版本下载-国内高速镜像

腾讯下载镜像地址:https://mirrors.cloud.tencent.com/debian/
阿里下载镜像地址:https://www.debian.org/mirror/list?spm=a2c6h.13651104.0.0.354a467cXCS3vg
网易下载镜像地址:http://tel.mirrors.163.com/debian/
清华下载镜像地址:https://mirror.tuna.tsinghua.edu.cn/debian/


配置方法

debian 7.x (wheezy)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb http://mirrors.aliyun.com/debian-archive/debian/ wheezy main non-free contrib
deb http://mirrors.aliyun.com/debian-archive/debian/ wheezy-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian-archive/debian/ wheezy main non-free contrib
deb-src http://mirrors.aliyun.com/debian-archive/debian/ wheezy-proposed-updates main non-free contrib

debian 8.x (jessie)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib

debian 9.x (stretch)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib

debian 10.x (buster)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

debian 11.x (bullseye)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
我爱玩网综合资源站,做最全最好的资源分享站点!
我爱玩网 » 虚拟机里安装debian9遇到的问题