sudo apt update
报错:
Reading package lists… Done E: Release file for
https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal-updates/InRelease
is not valid yet (invalid for another 9d 23h 6min 27s). Updates for
this repository will not be applied. E: Release file for
https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal-backports/InRelease
is not valid yet (invalid for another 9d 23h 6min 47s). Updates for
this repository will not be applied. E: Release file for
https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal-security/InRelease
is not valid yet (invalid for another 9d 23h 6min 16s). Updates for
this repository will not be applied.
sudo apt install -f
报错
Preparing to unpack …/libgl-dev_1.3.1-1_amd64.deb …
Unpacking libgl-dev:amd64 (1.3.1-1) …
dpkg: error processing archive /var/cache/apt/archives/libgl-dev_1.3.1-1_amd64.deb (–unpack):
trying to overwrite ‘/usr/include/GL/gl.h’, which is also in package mesa-common-dev:amd64 20.0.8-0ubuntu1~18.04.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack …/libglx-dev_1.3.1-1_amd64.deb …
Unpacking libglx-dev:amd64 (1.3.1-1) …
dpkg: error processing archive /var/cache/apt/archives/libglx-dev_1.3.1-1_amd64.deb (–unpack):
trying to overwrite ‘/usr/include/GL/glx.h’, which is also in package mesa-common-dev:amd64 20.0.8-0ubuntu1~18.04.1
Errors were encountered while processing:
/var/cache/apt/archives/libgl-dev_1.3.1-1_amd64.deb
/var/cache/apt/archives/libglx-dev_1.3.1-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo dpkg --configure -a
报错
$ sudo dpkg --configure -a
[sudo] password for wjc:
dpkg: dependency problems prevent configuration of libglvnd-dev:amd64:
libglvnd-dev:amd64 depends on libgl-dev (>= 1.3.0-1); however:
Package libgl-dev:amd64 is not installed.
libglvnd-dev:amd64 depends on libglx-dev (>= 1.3.0-1); however:
Package libglx-dev:amd64 is not installed.dpkg: error processing package libglvnd-dev:amd64 (–configure):
dependency problems - leaving unconfigured dpkg: dependency problems
prevent configuration of libglvnd-core-dev:amd64:
libglvnd-core-dev:amd64 depends on libglvnd-dev; however: Package
libglvnd-dev:amd64 is not configured yet.dpkg: error processing package libglvnd-core-dev:amd64 (–configure):
dependency problems - leaving unconfigured Errors were encountered
while processing: libglvnd-dev:amd64 libglvnd-core-dev:amd64
可能是系统时间出问题了
手动修改服务器时间:
启用网络时间协议:
为了保证时间的准确性,推荐使用NTP网络时间协议来同步时间。对的,跟windows中的 Internet 时间同步是一样一样的。
NTP(Network Time Protocol,网络时间协议)是用来使网络中的各个计算机时间同步的一种协议。NTP可以使计算机时钟与 Internet 时间服务器同步。 这意味着可以更新计算机上的时钟,以与时间服务器上的时钟匹配,这有助于确保计算机上的时钟是准确的。它的用途是把计算机的时钟同步到世界协调时间UTC,其精度在局域网内可达0.1ms,在互联网上绝大多数的地方其精度可以达到1-50ms。
运行以下命令,启用NTP:
sudo timedatectl set-ntp true
启用NTP以后,时间就是正常的吗?我们来通过date命令来查看当前时间:
date
若没对上现在时间,说明时区不正常
使用以下命令修改本地时区:
sudo dpkg-reconfigure tzdata
在“Configuring tzdata”中,依次选择Asia、Chongqing,回车确认,出现了以下提示信息:
cp: cannot create regular file '/etc/localtime.dpkg-new': Read-only file system
Current default time zone: 'Asia/Chongqing'
Local time is now: Mon Apr 6 08:49:52 UTC 2015.
Universal Time is now: Mon Apr 6 08:49:52 UTC 2015.
debconf: DbDriver "config": could not write /var/cache/debconf/config.dat-new: Read-only file system
简单来说,就是文件系统是只读的,不能创建etc/localtime.dpkg-new文件和不能写config.dat-new文件。
当前默认的时区是已经改成了我们想要的’Asia/Chongqing’,但是本地时间和世界时间还是一样的,这里还有问题,应该就是只读文件系统造成时区没有完全配置。
使得文件系统可写
通过askubuntu找到了Read-only file system问题的解决办法,运行以下命令使得文件系统可写。
重复第二步修改时区
这一次重新配置时区就比较顺利了。本地时间变成了CST时间,也就是China Standard Time UTC+8:00 中国沿海时间(北京时间)。
Current default time zone: 'Asia/Chongqing'
Local time is now: Mon Apr 6 55 55 173)">173)">16:55:50 CST 2015.
Universal Time is now: Mon Apr 6 08:55:50 UTC 2015.
ubuntu@localhost:/etc$ date
Mon Apr 6 55 173)">17:55 173)">19:56 CST 2015
ubuntu@localhost:/etc$ timedatectl status
Local time: Mon 2015-04-06 55 173)">17:55 173)">36:55 173)">36 CST
Universal time: Mon 2015-04-06 09:55 173)">36:55 173)">36 UTC
RTC time: n/a
Time zone: Asia/Chongqing (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a