Simple operation of installing vi command in docker container

Simple operation of installing vi command in docker container

When using a docker container, sometimes vim is not installed in it, and when you type the vim command, it prompts: vim: command not found. At this time, you need to install vim, but when you type the apt-get install vim command, it prompts:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vim

At this time, you need to type:

apt-get update

The purpose of this command is to synchronize the indexes of the sources listed in /etc/apt/sources.list and /etc/apt/sources.list.d so that the latest software packages can be obtained.

After the update is complete, type the command again:

apt-get install vim

Just run the command.

Supplement: Install vim, telnet, ifconfig, and ping commands in the docker container

When using a docker container, sometimes vim is not installed in it, and when you type the vim command, it prompts: vim: command not found. At this time, you need to install vim, but when you type the apt-get install vim command, it prompts:

Reading package lists... Done
Building dependency tree 
Reading state information... Done
E: Unable to locate package vim

At this time, you need to type: apt-get update,

The purpose of this command is to synchronize the indexes of the sources listed in /etc/apt/sources.list and /etc/apt/sources.list.d so that the latest software packages can be obtained.

After the update is complete, type the command again:

apt-get install vim install vim

apt-get install telnet telnet

apt-get install net-tools install ifconfig

apt install iputils-ping install ping

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • How to install the latest version of docker using deepin apt command
  • Detailed explanation of the installation commands and usage of Docker and FastDFS
  • Summary of common Docker commands: installation, mirroring, and basic container operations
  • Detailed explanation of how to install Docker and operate commands under CentOS 7
  • Docker installation and configuration command code examples

<<:  CSS example code for implementing sliding doors

>>:  Pitfalls based on MySQL default sorting rules

Recommend

Native js to achieve seamless carousel effect

Native js realizes the carousel effect (seamless ...

Analysis of MySQL query sorting and query aggregation function usage

This article uses examples to illustrate the use ...

Briefly describe the MySQL InnoDB storage engine

Preface: The storage engine is the core of the da...

Element Timeline implementation

Table of contents Components - Timeline Custom no...

Example code for implementing random roll caller in html

After this roll call device starts calling the ro...

How to insert a link in html

Each web page has an address, identified by a URL...

Optimization of MySQL thread_stack connection thread

MySQL can be connected not only through the netwo...

Vertical and horizontal splitting of MySQL tables

Vertical Split Vertical splitting refers to the s...

MySQL data analysis storage engine example explanation

Table of contents 1. Introduce cases 2. View the ...

Example of how to deploy MySQL 8.0 using Docker

1. Refer to the official website to install docke...

Several ways to switch between Vue Tab and cache pages

Table of contents 1. How to switch 2. Dynamically...

Detailed explanation of Linux rpm and yum commands and usage

RPM package management A packaging and installati...

VSCode Development UNI-APP Configuration Tutorial and Plugin

Table of contents Written in front Precautions De...

MySQL common backup commands and shell backup scripts sharing

To back up multiple databases, you can use the fo...

Summary of Spring Boot Docker packaging tools

Table of contents Spring Boot Docker spring-boot-...