apt-get E: invalid for another 97d 16h 31min 18s) / ubuntu修改系统时间
一、前言
在 Linux 系统上想要安装一个工具软件,总是无法安装成功。
查找了很多方式,如修改镜像源为阿里云镜像,清华大学镜像,然后执行 sudo apt-get update等,总是无法成功。
root@sonic:/etc/apt# sudo apt-get update
Get:1 http://debian-archive.trafficmanager.net/debian bullseye InRelease [116 kB]
Get:2 http://debian-archive.trafficmanager.net/debian-security bullseye-security InRelease [44.1 kB]
Get:3 http://debian-archive.trafficmanager.net/debian bullseye-backports InRelease [44.2 kB]
Get:4 https://download.docker.com/linux/debian bullseye InRelease [43.3 kB]
Reading package lists... Done
E: Release file for http://debian-archive.trafficmanager.net/debian/dists/bullseye/InRelease is not valid yet (invalid for another 97d 16h 31min 18s). Updates for this repository will not be applied.
E: Release file for http://debian-archive.trafficmanager.net/debian-security/dists/bullseye-security/InRelease is not valid yet (invalid for another 100d 13h 50min 19s). Updates for this repository will not be applied.
E: Release file for http://debian-archive.trafficmanager.net/debian/dists/bullseye-backports/InRelease is not valid yet (invalid for another 100d 9h 7min 52s). Updates for this repository will not be applied.
E: Release file for https://download.docker.com/linux/debian/dists/bullseye/InRelease is not valid yet (invalid for another 80d 20h 34min 28s). Updates for this repository will not be applied.
root@sonic:/etc/apt#
root@sonic:/etc/apt#
root@sonic:/etc/apt#
后面偶然看到这边博文 原文链接地址 ,才确定是系统时间戳不正确导致的问题。
二、修改时区和更新时间
1、概念
Ubuntu的时间分为两个种类
Ubuntu时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟。
2、查看当前时间
root@sonic:/etc/apt# date -R # 查看系统时间
Sat, 02 Apr 2022 17:18:04 +0000 # 当前时区为0时区
root@sonic:/etc/apt#
root@sonic:/etc/apt# sudo hwclock --show # 查看硬件时间
2022-04-02 17:18:15.655539+00:00
3、运行 tzselect 选择时区
4、复制文件到 /etc 目录下,并查看时区
root@sonic:/etc/apt# sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
root@sonic:/etc/apt# date -R
Sun, 03 Apr 2022 01:20:59 +0800 # 时区为东8区
root@sonic:/etc/apt#
5、设置正确的系统时间
root@sonic:/etc/apt# sudo date -s 07/12/22 # 修改日期
Tue 12 Jul 2022 12:00:00 AM CST
root@sonic:/etc/apt# sudo date -s 15:38:00 # 修改时间
Tue 12 Jul 2022 03:38:00 PM CST
root@sonic:/etc/apt# sudo hwclock --systohc # 修改硬件CMOS时间;这个步骤非常重要,如果没有这一步,重启后,时区又会发生改变
root@sonic:/etc/apt#
root@sonic:/etc/apt#
root@sonic:/etc/apt# date
Tue 12 Jul 2022 03:38:16 PM CST # 系统时间正确
root@sonic:/etc/apt#
apt-get E: invalid for another 97d 16h 31min 18s) / ubuntu修改系统时间相关推荐
- apt更新显示以下错误消息Err:1 http://ports.ubuntu.com xenial InRelease Temporary failure resolving ‘ports.ubunt
apt更新显示以下错误消息Err:1 http://ports.ubuntu.com xenial InRelease Temporary failure resolving 'ports.ubunt ...
- ubuntu linux编译apt,Ubuntu Linux系统下apt-get命令详解
整理了Ubuntu Linux操作系统下apt-get命令的详细说明,分享给大家. 常用的APT命令参数: apt-cache search package 搜索包 apt-cache show pa ...
- Ubuntu 修改apt 源
2019独角兽企业重金招聘Python工程师标准>>> 方法: 1.修改源地址: cp /etc/apt/sources.list /etc/apt/sources.list.bak ...
- Linux ubuntu修改软件源为国内源;解决apt install、PPA源太慢;
阿里源 修改为阿里源,只需要执行命令: sed -i 's/\/\/.*\/ubuntu/\/\/mirrors.aliyun.com\/ubuntu/g' /etc/apt/sources.list ...
- apt update Updating from such a repository can‘t be done securely, and is therefore
执行apt update 报错如图: Err:6 http://mirrors.aliyun.com/ubuntu bionic Release SECURITY: URL redirect targ ...
- Ubuntu简要操作
官网 https://cn.ubuntu.com/ 最小镜像 https://help.ubuntu.com/community/Installation/MinimalCD/ 下载最小镜像 http ...
- Linux命令大全(入门必备)
文章目录 一.查看系统信息 二.日期 `将日期存入数组` 三.系统的关机.重启以及登出 四.文件和目录 五.文件搜索 `find` 查找重复文件 六.挂载文件系统 fuser 七.磁盘 `磁盘空间` ...
- Debian 官方源换为国内的源的操作方法
Debian 官方源换为国内的源的操作方法 在镜像的构建的过程中,出现了如下报错: E: Release file for http://deb.debian.org/debian/dists/bus ...
- Ubuntu常用命令大全[显示桌面]
Ubuntu常用命令大全 查看软件xxx安装内容 #dpkg -L xxx 查找软件 #apt-cache search 正则表达式 查找文件属于哪个包 #dpkg -S filename apt-f ...
最新文章
- 建立双链表(头插法)
- VTK:Utilities之CheckVTKVersion
- 【转】PowerShell入门(五):Cmd命令与PowerShell命令的交互
- C++(8)--数组及常用算法
- 网易 html5,别再想不开做H5了
- php 还原mysql_PHP备份/还原MySQL数据库的代码
- 填报true\false和复选框应用及导出打印显示复
- python jupyter notebook下载_Jupyter notebook 安装
- win10系统进行电脑分盘
- 现阶段网络广告的形式并举例说明?
- Python+Vue计算机毕业设计H5的豫宛旅游网站v6giy(源码+程序+LW+部署)
- richTextBox相关操作
- 第二阶段--团队冲刺--第八天
- 【转】这些JavaScript编程黑科技,装逼指南,高逼格代码,让你惊叹不已
- 《JavaScript AST其实很简单》五、Step4-平坦化控制流
- 2021卫辉高考成绩查询,卫辉中考成绩查询2021
- 微信小程序中实现一个金额摇奖效果
- 安装Visual Studio .NET 2003 时提示 FrontPage 2000 Web 客户端扩展失败
- ffdshow 编译过程
- 五种大数据框架你必须要知道