我从以下网址下载了最新的 coreutils 源代码 (coreutils-9.1.tar.xz)https://mirrors.kernel.org/gnu/coreutils/稍微修改一下输出ls
以简单地打印哈喽,美丽的人们!每次发出命令时。解压存档并浏览目录后,coreutils-9.1/src/
我继续ls.c
使用 nano 编辑器编辑文件。我只需在函数printf("Hello there you beautiful people! \n");
的第一行插入main
。保存文件并返回到coreutils-9.1
我必须配置gcc 编译器运行 或./configure
。bash configure
我第一次能够做到这一点,并且Makefile
会生成一个,我向其发出make
命令,然后是sudo make install
。现在,每次ls
调用该命令时,哈喽,美丽的人们!显示在终端屏幕上。
问题是我无法逆转这一情况,因为每次我尝试运行该bash configure
命令时都会出现此错误。
checking for a BSD-compatible install... /usr/local/bin/install -c
checking whether build environment is sane... configure: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment
configure: error: newly created file is older than distributed files!
Check your system clock
然后我下载了眼鏡源代码位于x11 应用程序包裹发放sudo apt-get source x11-apps
。同样的,我导航到配置bash 脚本是,我发出bash configure
命令,然后我遇到了同样的错误。那么,这肯定意味着我无法配置我下载的任何源代码,因为我没有弄乱眼鏡源代码与命令无关ls
。
回到coreutils-9.1
目录我打开配置日志文件并找到错误消息以及它来自的行配置文件
configure:5090: looking for aux files: config.rpath config.guess config.sub compile missing install-sh
configure:5103: trying ./build-aux/
configure:5132: ./build-aux/config.rpath found
configure:5132: ./build-aux/config.guess found
configure:5132: ./build-aux/config.sub found
configure:5132: ./build-aux/compile found
configure:5132: ./build-aux/missing found
configure:5114: ./build-aux/install-sh found
configure:5268: checking for a BSD-compatible install
configure:5341: result: /usr/local/bin/install -c
configure:5352: checking whether build environment is sane
configure:5388: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment
configure:5404: error: newly created file is older than distributed files!
Check your system clock
然后我打开配置使用 nano 文件并导航到行号5388并找到这个
if test "$*" != "X $srcdir/configure conftest.file" \
&& test "$*" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
我有另一台装有 Ubuntu 21.04 的虚拟机,我可以毫无问题地在其中完成此操作。这台虚拟机装有 Ubuntu 22.04,我不知道该怎么做或如何继续。希望我尽可能清楚地说明我做了什么以及我想做什么。
PD 这是我的第一篇文章。我希望遵守规则和惯例。