当前位置: 首页 > news >正文

bash: unzip: 未找到命令,sudo: nano:找不到命令

在 Ubuntu/Debian 系统上
打开终端并运行以下命令:

sudo apt update
sudo apt install unzip

在 CentOS/RHEL 系统上
打开终端并运行以下命令:

sudo yum install unzip

在 macOS 上
如果您使用的是 macOS,可以使用 Homebrew 安装 unzip(通常 macOS 默认已安装):

brew install unzip

在 Windows 上
如果您在使用 Windows 的 WSL(Windows Subsystem for Linux),可以按照上述步骤安装。在 Windows 中,您可以使用文件资源管理器右键点击 ZIP 文件并选择“解压缩”选项。

安装完成后
安装完成后,您可以再次尝试解压文件

后续问题

[root@master01 www]# sudo yum install unzip
已加载插件:fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"One of the configured repositories failed (未知),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot find a valid baseurl for repo: base/7/x86_64

更换 YUM 源
如果问题仍然存在,您可以考虑更换 YUM 源。以下是更换为阿里云的 YUM 源的步骤:

备份原有的 YUM 源配置:

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

编辑 YUM 源配置文件:

sudo nano /etc/yum.repos.d/CentOS-Base.repo

将以下内容替换到文件中:

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos7[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos7[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centos7
保存并退出,然后运行以下命令以清除缓存并更新:
sudo yum clean all
sudo yum makecache
  1. 安装 unzip
    在更新了 YUM 源后,您可以再次尝试安装 unzip:
sudo yum install unzip
http://www.lryc.cn/news/448799.html

相关文章:

  • tauri开发配置文件和文件夹访问路径问题
  • 【web安全】——信息收集
  • 赵长鹏今日获释,下一步会做什么?币安透露2024年加密货币牛市的投资策略!
  • SpringMVC之ContextHolder
  • 什么是SQL注入?
  • 混合密码系统——用对称密钥提高速度,用公钥密码保护会话密钥
  • Three.js粒子系统与特效
  • Tableau数据可视化入门
  • Linux云计算 |【第四阶段】RDBMS1-DAY2
  • 后台监控中的云边下控耗时、边缘采集耗时 、云边下控量
  • 【学习笔记】手写 Tomcat 四
  • 探索基因奥秘:汇智生物如何利用组蛋白甲基化修饰测序技术革新农业植物基因组研究?
  • 二叉搜索树的介绍、模拟实现二叉搜索树、leetcode---根据二叉树创建字符串、leetcode---二叉树的最近公共祖先等的介绍
  • 人工智能的基本概念与发展历程
  • 【IPV6从入门到起飞】5-6 IPV6+Home Assistant(ESPHome+ESP-cam)实时监控
  • 生成式AI的未来
  • 实用好软-----电脑端 从视频中导出音频的方便工具
  • 3-基于容器安装carla
  • 循环程序结构课堂练习题解
  • SpringBoot搭建
  • 【ChatGPT】Python 实现计算两线段的变换矩阵
  • 大数据Hologres(二):Hologres 快速入门
  • 华为仓颉语言入门(7):深入理解 do-while 循环及其应用
  • 在传销案件中数据库取证的分步指南
  • 数据结构与算法——Java实现 21.栈
  • 实验一 网络基础及仿真模拟软件Packet Tracer 入门
  • 建立分支提交代码
  • 认识 Linux操作系统
  • AI时代程序员的核心竞争力提升与保持之道
  • 状态模式原理剖析