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

Unicode signature BOM (Byte Order Mark) issue for UTF-8 files

I recently encountered a strange thing when debug...

Detailed explanation of the use of Vue3 state management

Table of contents background Provide / Inject Ext...

Vue implements the method of displaying percentage of echart pie chart legend

This article mainly introduces the pie chart data...

Detailed explanation of MySQL EXPLAIN output columns

1. Introduction The EXPLAIN statement provides in...

Detailed explanation of the initialization mechanism in bash

Bash Initialization Files Interactive login shell...

Summary of MySQL slow log related knowledge

Table of contents 1. Introduction to Slow Log 2. ...

Detailed explanation of mysql partition function and example analysis

First, what is database partitioning? I wrote an ...

Solve the problem of running jupyter notebook on the server

Table of contents The server runs jupyter noteboo...

Detailed explanation of Object.create instance usage in js

1. Create a new object using the Object.create() ...

Let's talk about the characteristics and isolation levels of MySQL transactions

The Internet is already saturated with articles o...

Native JS to implement image carousel JS to implement small advertising plug-in

Recently I want to use native JS to implement som...

How to add vector icons to web font files in web page production

As we all know, there are two types of images in c...

Two ways to implement HTML to randomly drag content positions

Test: Chrome v80.0.3987.122 is normal There are t...