自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

詳細講解麻煩的Ubuntu時間設(shè)置

系統(tǒng) Linux
每次安裝Ubuntu的時候,Ubuntu時間設(shè)置總是一個比較麻煩的事情,除了選時區(qū)之外,會被UTC和本地時間弄得頭大。還有之前裝雙系統(tǒng)的時候,會出現(xiàn)Windows時間和Linux時間相差8小時的問題。

在向大家詳細介紹Ubuntu時間設(shè)置之前,首先讓大家了解下Linux時間相差,然后全面介紹Ubuntu時間設(shè)置,希望對大家有用。Ubuntu 團隊對它的使用者公開的承諾:Ubuntu 永遠免費 , 并且對于 "企業(yè)版本" 沒有任何額外的費用, 在同樣的自由團隊上,將最好的工作成果帶給每一個人。

Ubuntu時間設(shè)置

每次安裝Ubuntu的時候,Ubuntu時間設(shè)置總是一個比較麻煩的事情,除了選時區(qū)之外,會被UTC和本地時間弄得頭大。還有之前裝雙系統(tǒng)的時候,會出現(xiàn)Windows時間和Linux時間相差8小時的問題。這里需要解決的問題是bios時間和系統(tǒng)時間的同步問題:在開機時,系統(tǒng)從bios獲得時間;關(guān)機時,系統(tǒng)向bios寫回時間。出現(xiàn)相差8小時的問題猜測是因為UTC和本地時間相差8小時(我們處在東八區(qū))。

可以用hwclock來同步。hwclock常用選項如下:
Usage: hwclock [function] [options...]
Functions:
--show        read hardware clock and print result
--set         set the rtc to the time given with --date
--hctosys     set the system time from the hardware clock
--systohc     set the hardware clock to the current system time
--adjust      adjust the rtc to account for systematic drift since the clock was last set or adjusted
Options:
--utc         the hardware clock is kept in coordinated universal time
--localtime   the hardware clock is kept in local time
--date        specifies the time to which to set the hardware clock

我的目標是為了實現(xiàn)bios和系統(tǒng)時間都使用本地時間。
首先Ubuntu時間設(shè)置區(qū):
sudo dpkg-reconfigure tzdata

然后查看系統(tǒng)時間和bios時間:
date; hwclock --show

之后的操作稍微有點技巧,需要判斷bios時間比本地時間早還是晚,一般而言,bios時間很可能被設(shè)置成UTC了,也就是說會比本地時間晚8小時,那么此時可以用下面的命令把Ubuntu時間設(shè)置系統(tǒng)先設(shè)置成bios(按照UTC顯示的)時間對應的本地時間:
sudo hwclock --localtime --hctosys

再次用 date; hwclock --show 查看會發(fā)現(xiàn)當前系統(tǒng)時間被改變了(正確改變成當前時間),但是bios時間仍然不變。

此時再把系統(tǒng)時間寫到bios時間上,注意這里的hwclock 不再使用 --localtime 選項:
sudo hwclock --systohc

以上的步驟可以重復使用,最終達到效果。如果覺得麻煩,應該可以直接用 hwclock --set 來對Ubuntu時間設(shè)置,不過我沒有嘗試過。

【編輯推薦】

  1. Ubuntu Linux系統(tǒng)的分區(qū)方案
  2. 查看Ubuntu VirtualBox服務器配置
  3. Ubuntu服務系統(tǒng)控制的基礎(chǔ)知識
  4. 啟用Ubuntu FrameBuffer系統(tǒng)編輯文件
  5. 網(wǎng)絡(luò)安裝Ubuntu設(shè)置虛擬機
責任編輯:佚名 來源: CSDN
相關(guān)推薦

2010-06-17 13:30:22

Grub修復工具

2009-12-01 18:35:22

阿爾法路由器設(shè)置

2009-12-22 10:34:18

靜態(tài)路由協(xié)議

2013-01-10 15:36:44

Android開發(fā)組件Intent

2009-04-03 08:21:37

AndroidGoogle移動OS

2011-04-07 15:53:39

2009-11-09 17:55:17

2010-03-11 09:36:10

Ubuntu Xwin

2019-08-13 16:10:38

UbuntuLinux時間同步

2010-03-16 16:03:52

Ubuntu vsft

2023-09-06 12:49:31

系統(tǒng)Ubuntu

2009-11-26 14:30:16

2011-06-14 15:39:46

單元測試

2023-03-17 08:11:25

2010-05-17 16:31:04

IIS Request

2024-07-09 09:08:36

golang簽名參數(shù)簽名時間

2010-04-29 10:15:01

Unix系統(tǒng)

2010-06-17 12:57:27

如何修復Grub

2009-09-25 17:03:29

Hibernate是什

2009-12-14 11:29:19

Linux查看命令
點贊
收藏

51CTO技術(shù)棧公眾號