Ubuntu中进行apt-get报找不到tzdata错误的解决办法

本文介绍了一个在Ubuntu系统中使用apt-get安装软件时出现的tzdata错误,并提供了详细的解决方案,包括删除特定文件后重新执行更新命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天在Ubuntu中进行apt-get时报以下错误:
正在设置 tzdata (2007i-0ubuntu0.6.10) ...
/var/lib/dpkg/info/tzdata.postinst: line 68: [: /usr/share/zoneinfo/User: binary operator expected
Running 'tzconfig' to set this system's timezone.
/var/lib/dpkg/info/tzdata.postinst: line 27: /usr/sbin/tzconfig: No such file or directory
dpkg:处理 tzdata (--configure)时出错:
子进程 post-installation script 返回了错误号 1
在处理时有错误发生:
tzdata
E: Sub-process /usr/bin/dpkg returned an error code (1) 

查了一下,论坛上也有不少朋友遇到这个问题,解决方法如下:
把/var/lib/dpkg/info/tzdata.postinst 删了 重新 apt-get update
# Dockerfile to build OpenSees, OpenSeesSP and OpenSeesMP # .. utilizes ubuntu:20.04 LTS as base # .. it will build all applications and place in /usr/local/bin # .. it will also install openmpi # .. to run OpenSeesSP and OpenSeesMP use mpiexec, e.g. mpiexec -n 2 OpenSeesSP example.tcl # written: fmk FROM ubuntu:20.04 SHELL ["/bin/bash", "-c"] WORKDIR /opensees RUN cp /etc/apt/sources.list /etc/apt/sources.list~ \ && sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata git \ && apt-get install -y sudo \ && sudo apt-get install -y cmake gcc g++ gfortran liblapack-dev git python3-pip \ && sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev libscalapack-openmpi-dev \ && pip3 install conan==1.60.1 \ && git clone --depth 1 --branch hdf5-1_12_2 https://github.com/HDFGroup/hdf5.git \ && cd hdf5 \ && ./configure --prefix=/usr/local/hdf5 \ && make \ && cd .. \ && git clone https://github.com/OpenSees/mumps.git \ && cd mumps \ && mkdir build \ && cd build \ && cmake .. -Darith=d \ && cmake --build . \ && cd ../.. \ && git clone https://github.com/OpenSees/OpenSees.git \ && cd OpenSees \ && mkdir build \ && cd build \ && conan install .. --build missing \ && cmake .. -DMUMPS_DIR=$PWD/../../mumps/build -DOPENMPI=TRUE -DSCALAPACK_LIBRARIES="/usr/lib/x86_64-linux-gnu/libscalapack-openmpi.so.2.1" \ && cmake --build . --config Release --target OpenSees \ && cmake --build . --config Release --target OpenSeesSP \ && cmake --build . --config Release --target OpenSeesMP \ && cp ./bin/* /usr/local/bin \ && cp -r ./lib/tcl8.6 /usr/local/lib \ && cd ../.. \ && rm -fr OpenSees \ && rm -fr hdf5 \ && rm -fr mumps # Dockerfile to build OpenSees, OpenSeesSP and OpenSeesMP # .. utilizes ubuntu:20.04 LTS as base # .. it will build all applications and place in /usr/local/bin # .. it will also install openmpi # .. to run OpenSeesSP and OpenSeesMP use mpiexec, e.g. mpiexec -n 2 OpenSeesSP example.tcl # written: fmk FROM ubuntu:20.04 SHELL ["/bin/bash", "-c"] WORKDIR /opensees RUN cp /etc/apt/sources.list /etc/apt/sources.list~ \ && sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata git \ && apt-get install -y sudo \ && sudo apt-get install -y cmake gcc g++ gfortran liblapack-dev git python3-pip \ && sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev libscalapack-openmpi-dev \ && pip3 install conan==1.60.1 \ && git clone --depth 1 --branch hdf5-1_12_2 https://github.com/HDFGroup/hdf5.git \ && cd hdf5 \ && ./configure --prefix=/usr/local/hdf5 \ && make \ && cd .. \ && git clone https://github.com/OpenSees/mumps.git \ && cd mumps \ && mkdir build \ && cd build \ && cmake .. -Darith=d \ && cmake --build . \ && cd ../.. \ && git clone https://github.com/OpenSees/OpenSees.git \ && cd OpenSees \ && mkdir build \ && cd build \ && conan install .. --build missing \ && cmake .. -DMUMPS_DIR=$PWD/../../mumps/build -DOPENMPI=TRUE -DSCALAPACK_LIBRARIES="/usr/lib/x86_64-linux-gnu/libscalapack-openmpi.so.2.1" \ && cmake --build . --config Release --target OpenSees \ && cmake --build . --config Release --target OpenSeesSP \ && cmake --build . --config Release --target OpenSeesMP \ && cp ./bin/* /usr/local/bin \ && cp -r ./lib/tcl8.6 /usr/local/lib \ && cd ../.. \ && rm -fr OpenSees \ && rm -fr hdf5 \ && rm -fr mumps
03-09
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值