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

MySQL 5.7.17 installation and configuration tutorial under Linux (Ubuntu)

Preface I have installed MySQL 5.6 before. Three ...

Example of implementing skeleton screen with Vue

Table of contents Skeleton screen use Vue archite...

Reasons and methods for Waiting for table metadata lock in MySQL

When MySQL performs DDL operations such as alter ...

Pure CSS to achieve cool neon light effect (with demo)

I have recently been following the CSS Animation ...

How to use the Linux nl command

1. Command Introduction nl (Number of Lines) adds...

WEB Chinese Font Application Guide

Using fonts on the Web is both a fundamental skill...

jQuery plugin to achieve carousel effect

A jQuery plugin every day - jQuery plugin to impl...

MySQL series tutorials for beginners

Table of contents 1. Basic concepts and basic com...

How to use CSS attribute selectors to splice HTML DNA

CSS attribute selectors are amazing. They can hel...

CSS example code for setting scroll bar style

The CSS implementation code for setting the scrol...

Summary of common Linux distribution mirror source configuration

I have been researching Linux recently and tried ...

How to configure MySQL8 in Nacos

1. Create the MySQL database nacos_config 2. Sele...

Docker container orchestration implementation process analysis

In actual development or production environments,...

jQuery implements accordion effects

This article shares the specific code of jQuery t...

Zen Coding Easy and fast HTML writing

Zen Coding It is a text editor plugin. In a text ...