หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Image Management Service/ Best Practices/ Configuring an ISO File as a Local Image Source

Configuring an ISO File as a Local Image Source

Updated on 2024-06-12 GMT+08:00

Context

When you install software on a Linux ECS, the network may be disconnected or resources on the network may be invalid, resulting in software installation failures. In this case, you can configure an ISO file as a local image source to install the software.

Package Managers

Before configuring a local source, you need to determine the package manager to be used. Generally, there are three types of package managers: yum, apt, and zypper.

  • yum is for RHEL-based OSs: RHEL, CentOS, EulerOS, and Fedora.
  • apt is for Debian and Ubuntu.
  • zypper is for SUSE and openSUSE.

Configuring a Local Image Source

Configure a local image source by following the instructions in yum, apt, or zypper.

  • yum
    1. Upload the ISO file to the ECS and mount it to the /mnt directory.

      mount XXX.iso /mnt

    2. Enter the /etc/yum.repo.d directory where the yum configuration file is stored and back up all .repo files. Then, create a .repo file, for example local.repo. Add the following information to the local.repo file:
      [rhel-local]
      name=local
      baseurl=file:///mnt
      enabled=1
      gpgcheck=0
      NOTE:

      The /mnt directory specified in the configuration file must be the same as the mounting directory of the ISO file.

    3. Clear yum.

      yum clean all

    4. Generate a new cache.

      yum makecache

  • apt
    1. Upload the ISO file to the ECS and mount it to the /mnt directory.

      mount XXX.iso /mnt

    2. Add the apt cdrom source.

      apt-cdrom -m -d /mnt/ add

    3. View the added source in the configuration file.

      cat /etc/apt/sources.list

    4. Update the source.

      apt-get update

  • zypper
    1. Upload the ISO file to the ECS.
    2. Add the ISO file as the source.

      sudo zypper addrepo iso:/?iso=/media/SOFTWARE/openSUSE-11.4-DVD-i586.iso DVDISO

      In the preceding command:

      • /media/SOFTWARE/openSUSE-11.4-DVD-i586.iso is the location of the ISO file.
      • DVDISO is the source alias.
    3. Check whether the source is successfully added.

      zypper repos

    4. Refresh the source.

      zypper refresh

Examples

The operations in Configuring a Local Image Source may be different depending on the OS version. Basically, you need to add the source and refresh it. Debian 10.1.0 and CentOS 8.0 are used as examples to describe how to add a local source.

  • Debian 10.1.0

    Run the cat /etc/apt/sources.list command to check whether the sources.list file contains a default cdrom source.

    Figure 1 Viewing the source

    The source directs to the CD-ROM drive /dev/cdrom. Debian 10.1.0 provides a soft link to link the CD-ROM drive to /media/cdrom.

    Figure 2 Checking the media directory

    Therefore, mount the ISO file to /media/cdrom.

  • CentOS 8.0
    1. Mount the ISO file to the /mnt directory.
    2. Rename all source files except CentOS-Media.repo in the /etc/yum.repo.d directory as .bak files or move them to another directory.
    3. Modify the CentOS-Media.repo file.
      Figure 3 Modifying the CentOS-Media.repo file

      The modifications in the red box are as follows:

      • Set baseurl to file:///mnt/BaseOS and file:///mnt/AppStream. mnt is the mounting directory of the ISO file. Delete invalid paths from the default configuration. Otherwise, a checksum error will occur.
      • Change the value of gpgcheck to 0, indicating that the check is not performed.
      • Change the value of enabled to 1 for the configurations to take effect.
    4. Clear yum and generate a new cache.

      yum clean all && yum makecache

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback