现象:编译Qt程序时,提示warning: File ‘/opt/Qt5.12.8/5.12.8/gcc_64/mkspecs/linux-g++/qmake.conf’ has modification time 716043631 s in the future
ubuntu@ubuntu-dev-machine:~/test/qt_test$ ls -alh /opt/
total 20K
drwxr-xr-x 5 root root 4.0K 6月 27 2045 .
drwxr-xr-x 25 root root 4.0K 10月 5 22:32 ..
drwxr-xr-x 9 root root 4.0K 6月 24 2045 Qt5.12.8
发现设备上的Qt目录的时间戳都是2045年,由于安装Qt时,系统没有安装ntp,导致系统没有同步时间,因此安装后的Qt文件都是2045年。
修改如下:
(1)在unbuntu上安装ntp,获取正确的时间
sudo apt install ntp
sudo systemctl enable ntp
sudo systemctl restart ntp
(2)批量更新目录的时间戳
find /opt -type f -exec touch {} +