解决:Command ‘ls‘ not found, but can be installed with: apt install coreutils


种一棵树最好的时间是10年前,其次就是现在,加油!
                                                                                   --by蜡笔小柯南

一、问题分析

我们使用Linux的Ubuntu系统时,一些基础的命令,如:lllsls -l ,发现都不能使用,提示如下报错信息:

在这里插入图片描述

Command 'ls' not found, but can be installed with: apt install coreutils

很可能因为核心工具包出现了问题,从错误的提示中,我们发现,让我们安装 apt install coreutils

二、问题解决

之前这些命令可以正常使用,突然就用不了了,我们可以使用如下命令,重新安装核心工具包

sudo apt install --reinstall coreutils

等待安装完成后,搞定!

root@740:~# uname -r Command 'uname' not found, but can be installed with: apt install coreutils root@740:~# apt install ^C root@740:~# uname Command 'uname' not found, but can be installed with: apt install coreutils root@740:~# apt install coreutils Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be upgraded: coreutils 1 upgraded, 0 newly installed, 0 to remove and 291 not upgraded. 1 not fully installed or removed. Need to get 0 B/1,437 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 126802 files and directories currently installed.) Preparing to unpack .../coreutils_8.32-4.1ubuntu1.2_amd64.deb ... Unpacking coreutils (8.32-4.1ubuntu1.2) over (8.32-4.1ubuntu1) ... Access denied: rename blocked for /usr/bin/logname.dpkg-new -> /usr/bin/logname dpkg: error processing archive /var/cache/apt/archives/coreutils_8.32-4.1ubuntu1.2_amd64.deb (--unpack): unable to install new version of '/usr/bin/logname': Permission denied Access denied: rename blocked for /usr/share/man/man1/logname.1.gz.dpkg-tmp -> /usr/share/man/man1/logname.1.gz dpkg: error while cleaning up: unable to restore backup version of '/usr/share/man/man1/logname.1.gz': Permission denied Access denied: rename blocked for /usr/share/doc/coreutils/changelog.Debian.gz.dpkg-tmp -> /usr/share/doc/coreutils/changelog.Debian.gz dpkg: error while cleaning up: unable to restore backup version of '/usr/share/doc/coreutils/changelog.Debian.gz': Permission denied Access denied: rename blocked for /usr/bin/logname.dpkg-tmp -> /usr/bin/logname dpkg: error while cleaning up: unable to restore backup version of '/usr/bin/logname': Permission denied Errors were encountered while processing: /var/cache/apt/archives/coreutils_8.32-4.1ubuntu1.2_amd64.deb needrestart is being skipped since dpkg has failed E: Sub-process /usr/bin/dpkg returned an error code (1)
最新发布
09-29
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

蜡笔小柯南

多谢投喂,感恩家人

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值