0
点赞
收藏
分享

微信扫一扫

Ubuntu开机直接tty1 没有图形界面(sudo apt-get install ubuntu-desktop不行?)

西风白羽 2022-03-15 阅读 87
ubuntu

刚才Ubuntu开机就进入tty1界面不知道怎么回事,ctrl+alt+f7不行。
sudo apt-get install ubuntu-desktop试了发现安装失败然后在网上找了半天,最后终于找到了,发现是网卡出现问题了,下载不成功。

解决:

1. 输入账户密码(输入密码时注意小键盘是否开启)

在这里插入图片描述

2. 安装桌面

sudo apt-get install ubuntu-desktop

如果无效,接着进行第三步。
这里发现根本就没有下载资源安装成功。

3. 先连接网络再装桌面

(1)连接网络

# 尝试联网
sudo dhclient eth0

# 如果显示cannot find device "eth0"
# 执行以下命令查看网卡名称
dmesg | grep eth
 
# 发现eth0被重命名成了ens33
# ens33:renamed from eth0
 
# 重新联网
sudo dhclient ens33
 
# 测试是否成功
ping www.baidu.com

(2)安装桌面

# 更新软件源
sudo apt-get update

# 重新安装桌面
sudo apt-get install ubuntu-desktop

# 重启
reboot

(3)如果更新失败,执行以下命令后再安装桌面:

# 修改dns
sudo vi /etc/resolv.conf

添加以下内容:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
#这里用的是阿里云的DNS服务器
nameserver 223.5.5.5  
nameserver 223.6.6.6

另外,可以参考 Ubuntu18.04 修改apt-get国内镜像源的方法 更换软件源。

举报

相关推荐

0 条评论