How to run vi on docker container?2019 Community Moderator ElectionHow do I edit a file after I shell to a Docker container?How to symlink a file in Linux?How to exit the Vim editor?How is Docker different from a virtual machine?How do I find all files containing specific text on Linux?How to get a Docker container's IP address from the host?Copying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryFrom inside of a Docker container, how do I connect to the localhost of the machine?How do I get into a Docker container's shell?

How can a new country break out from a developed country without war?

pipe commands inside find -exec?

Is there any common country to visit for uk and schengen visa?

What is the difference between something being completely legal and being completely decriminalized?

Why is participating in the European Parliamentary elections used as a threat?

Air travel with refrigerated insulin

How to balance a monster modification (zombie)?

What are the rules for concealing thieves' tools (or items in general)?

is this saw blade faulty?

What is the tangent at a sharp point on a curve?

Why are there no stars visible in cislunar space?

"Marked down as someone wanting to sell shares." What does that mean?

What will the Frenchman say?

Why is "la Gestapo" feminine?

Why I don't get the wanted width of tcbox?

How to read string as hex number in bash?

How can an organ that provides biological immortality be unable to regenerate?

DisplayForm problem with pi in FractionBox

Should I be concerned about student access to a test bank?

Do I need an EFI partition for each 18.04 ubuntu I have on my HD?

Print a physical multiplication table

Unfrosted light bulb

Turning a hard to access nut?

Error in master's thesis, I do not know what to do



How to run vi on docker container?



2019 Community Moderator ElectionHow do I edit a file after I shell to a Docker container?How to symlink a file in Linux?How to exit the Vim editor?How is Docker different from a virtual machine?How do I find all files containing specific text on Linux?How to get a Docker container's IP address from the host?Copying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryFrom inside of a Docker container, how do I connect to the localhost of the machine?How do I get into a Docker container's shell?










32















I have installed docker on my host virtual machine. And now want to create a file using vi.



But it's showing me an error:



bash: vi: command not found









share|improve this question



















  • 1





    vi may not be installed inside container. Which container have you installed and run?

    – Hüseyin BABAL
    Jul 20 '15 at 11:57






  • 1





    You have to be more specific. Are you trying to run vi inside a container, if so which image is the container based on? In all likelihood you don't have vi installed. (apt-get install vim)

    – wpp
    Jul 20 '15 at 12:51











  • It depends on which image you are building from. Most probably image you are using is so lighter that it only has things you need to run as an image. You need to manually install packages you need.

    – illusionist
    Jul 20 '15 at 13:59






  • 2





    You probably shouldn't be doing config inside a container. Do it in the Dockerfile instead.

    – Adrian Mouat
    Jul 20 '15 at 14:41






  • 3





    Possible duplicate of How to edit file after I shell to a docker container?

    – A.B.
    Jan 29 '16 at 12:21















32















I have installed docker on my host virtual machine. And now want to create a file using vi.



But it's showing me an error:



bash: vi: command not found









share|improve this question



















  • 1





    vi may not be installed inside container. Which container have you installed and run?

    – Hüseyin BABAL
    Jul 20 '15 at 11:57






  • 1





    You have to be more specific. Are you trying to run vi inside a container, if so which image is the container based on? In all likelihood you don't have vi installed. (apt-get install vim)

    – wpp
    Jul 20 '15 at 12:51











  • It depends on which image you are building from. Most probably image you are using is so lighter that it only has things you need to run as an image. You need to manually install packages you need.

    – illusionist
    Jul 20 '15 at 13:59






  • 2





    You probably shouldn't be doing config inside a container. Do it in the Dockerfile instead.

    – Adrian Mouat
    Jul 20 '15 at 14:41






  • 3





    Possible duplicate of How to edit file after I shell to a docker container?

    – A.B.
    Jan 29 '16 at 12:21













32












32








32


3






I have installed docker on my host virtual machine. And now want to create a file using vi.



But it's showing me an error:



bash: vi: command not found









share|improve this question
















I have installed docker on my host virtual machine. And now want to create a file using vi.



But it's showing me an error:



bash: vi: command not found






linux docker vi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 4 '18 at 10:25









Line

92911129




92911129










asked Jul 20 '15 at 11:55









Krati JainKrati Jain

169123




169123







  • 1





    vi may not be installed inside container. Which container have you installed and run?

    – Hüseyin BABAL
    Jul 20 '15 at 11:57






  • 1





    You have to be more specific. Are you trying to run vi inside a container, if so which image is the container based on? In all likelihood you don't have vi installed. (apt-get install vim)

    – wpp
    Jul 20 '15 at 12:51











  • It depends on which image you are building from. Most probably image you are using is so lighter that it only has things you need to run as an image. You need to manually install packages you need.

    – illusionist
    Jul 20 '15 at 13:59






  • 2





    You probably shouldn't be doing config inside a container. Do it in the Dockerfile instead.

    – Adrian Mouat
    Jul 20 '15 at 14:41






  • 3





    Possible duplicate of How to edit file after I shell to a docker container?

    – A.B.
    Jan 29 '16 at 12:21












  • 1





    vi may not be installed inside container. Which container have you installed and run?

    – Hüseyin BABAL
    Jul 20 '15 at 11:57






  • 1





    You have to be more specific. Are you trying to run vi inside a container, if so which image is the container based on? In all likelihood you don't have vi installed. (apt-get install vim)

    – wpp
    Jul 20 '15 at 12:51











  • It depends on which image you are building from. Most probably image you are using is so lighter that it only has things you need to run as an image. You need to manually install packages you need.

    – illusionist
    Jul 20 '15 at 13:59






  • 2





    You probably shouldn't be doing config inside a container. Do it in the Dockerfile instead.

    – Adrian Mouat
    Jul 20 '15 at 14:41






  • 3





    Possible duplicate of How to edit file after I shell to a docker container?

    – A.B.
    Jan 29 '16 at 12:21







1




1





vi may not be installed inside container. Which container have you installed and run?

– Hüseyin BABAL
Jul 20 '15 at 11:57





vi may not be installed inside container. Which container have you installed and run?

– Hüseyin BABAL
Jul 20 '15 at 11:57




1




1





You have to be more specific. Are you trying to run vi inside a container, if so which image is the container based on? In all likelihood you don't have vi installed. (apt-get install vim)

– wpp
Jul 20 '15 at 12:51





You have to be more specific. Are you trying to run vi inside a container, if so which image is the container based on? In all likelihood you don't have vi installed. (apt-get install vim)

– wpp
Jul 20 '15 at 12:51













It depends on which image you are building from. Most probably image you are using is so lighter that it only has things you need to run as an image. You need to manually install packages you need.

– illusionist
Jul 20 '15 at 13:59





It depends on which image you are building from. Most probably image you are using is so lighter that it only has things you need to run as an image. You need to manually install packages you need.

– illusionist
Jul 20 '15 at 13:59




2




2





You probably shouldn't be doing config inside a container. Do it in the Dockerfile instead.

– Adrian Mouat
Jul 20 '15 at 14:41





You probably shouldn't be doing config inside a container. Do it in the Dockerfile instead.

– Adrian Mouat
Jul 20 '15 at 14:41




3




3





Possible duplicate of How to edit file after I shell to a docker container?

– A.B.
Jan 29 '16 at 12:21





Possible duplicate of How to edit file after I shell to a docker container?

– A.B.
Jan 29 '16 at 12:21












7 Answers
7






active

oldest

votes


















31














login into container with the following command:



docker exec -it <container> bash


Then , run the following command .



apt-get update
apt-get install vim





share|improve this answer























  • worked it (Y), Thanks

    – Jamsheer
    Aug 6 '18 at 10:52











  • Should you encounter permission denied issue while running apt-get, you need to run docker exec as root. "docker exec -u root -it <container> bash". Then apt-get should work.

    – java25
    Feb 9 at 19:12


















30














Your container probably haven't installed it out of the box.



Run apt-get install vim in the terminal and you should be ready to go.






share|improve this answer


















  • 2





    Yep, but I prefer vim-tiny (Ubuntu)

    – Ben Whaley
    Jul 21 '15 at 0:48






  • 20





    Don't forget to run apt-get update first.

    – AVProgrammer
    Sep 4 '16 at 0:02











  • Before running 'apt-get install vim', you need to run 'apt-get update'.

    – user1521213
    Sep 26 '18 at 12:59


















10














The command to run depends on what base image you are using.



For Alpine, vi is installed as part of the base OS. Installing vim would be:



apk -U add vim


For Debian and Ubuntu:



apt-get update && apt-get install -y vim


For CentOS, vi is usually installed with the base OS. For vim:



yum install -y vim


This should only be done in early development. Once you get a working container, the changes to files should be made to your image or configs stored outside of your container. Update your Dockerfile and other files it uses to build a new image. This certainly shouldn't be done in production since changes inside the container are by design ephemeral and will be lost when the container is replaced.






share|improve this answer






























    3














    Add the following line in your Dockerfile then rebuild the docker image.



    RUN apt-get update && apt-get install -y vim





    share|improve this answer
































      2














      Alternatively, keep your docker images small by not installing unnecessary editors. You can edit the files over ssh from the docker host to the container:



      vim scp://remoteuser@container-ip//path/to/document





      share|improve this answer






























        2














        To install within your Docker container you can run command




        docker exec apt-get update && apt-get install -y vim




        But this will be limited to the container in which vim is installed.
        To make it available to all the containers, edit the Dockerfile and add




        RUN apt-get update && apt-get install -y vim




        or you can also extend the image in the new Dockerfile and add above command. Eg.




        FROM < image name >



        RUN apt-get update && apt-get install -y vim







        share|improve this answer






























          0














          Inside container(in docker, not in VM), by default these are not installed.
          Even apt-get, wget will not work. My VM is running on Ubuntu 17.10. For me yum package manaager worked.



          Yum is not part of debian or ubuntu. It is part of red-hat. But, it works in Ubuntu and it is installed by default like apt-get



          Tu install vim, use this command



          yum install -y vim-enhanced 


          To uninstall



          yum install -y vim-enhanced 


          Similarly,



          yum install -y wget 
          yum install -y sudo


          -y is for assuming yes if prompted for any qustion asked after doing yum install packagename






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31515863%2fhow-to-run-vi-on-docker-container%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            7 Answers
            7






            active

            oldest

            votes








            7 Answers
            7






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            31














            login into container with the following command:



            docker exec -it <container> bash


            Then , run the following command .



            apt-get update
            apt-get install vim





            share|improve this answer























            • worked it (Y), Thanks

              – Jamsheer
              Aug 6 '18 at 10:52











            • Should you encounter permission denied issue while running apt-get, you need to run docker exec as root. "docker exec -u root -it <container> bash". Then apt-get should work.

              – java25
              Feb 9 at 19:12















            31














            login into container with the following command:



            docker exec -it <container> bash


            Then , run the following command .



            apt-get update
            apt-get install vim





            share|improve this answer























            • worked it (Y), Thanks

              – Jamsheer
              Aug 6 '18 at 10:52











            • Should you encounter permission denied issue while running apt-get, you need to run docker exec as root. "docker exec -u root -it <container> bash". Then apt-get should work.

              – java25
              Feb 9 at 19:12













            31












            31








            31







            login into container with the following command:



            docker exec -it <container> bash


            Then , run the following command .



            apt-get update
            apt-get install vim





            share|improve this answer













            login into container with the following command:



            docker exec -it <container> bash


            Then , run the following command .



            apt-get update
            apt-get install vim






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 27 '17 at 9:52









            arunprakashpjarunprakashpj

            1,1821422




            1,1821422












            • worked it (Y), Thanks

              – Jamsheer
              Aug 6 '18 at 10:52











            • Should you encounter permission denied issue while running apt-get, you need to run docker exec as root. "docker exec -u root -it <container> bash". Then apt-get should work.

              – java25
              Feb 9 at 19:12

















            • worked it (Y), Thanks

              – Jamsheer
              Aug 6 '18 at 10:52











            • Should you encounter permission denied issue while running apt-get, you need to run docker exec as root. "docker exec -u root -it <container> bash". Then apt-get should work.

              – java25
              Feb 9 at 19:12
















            worked it (Y), Thanks

            – Jamsheer
            Aug 6 '18 at 10:52





            worked it (Y), Thanks

            – Jamsheer
            Aug 6 '18 at 10:52













            Should you encounter permission denied issue while running apt-get, you need to run docker exec as root. "docker exec -u root -it <container> bash". Then apt-get should work.

            – java25
            Feb 9 at 19:12





            Should you encounter permission denied issue while running apt-get, you need to run docker exec as root. "docker exec -u root -it <container> bash". Then apt-get should work.

            – java25
            Feb 9 at 19:12













            30














            Your container probably haven't installed it out of the box.



            Run apt-get install vim in the terminal and you should be ready to go.






            share|improve this answer


















            • 2





              Yep, but I prefer vim-tiny (Ubuntu)

              – Ben Whaley
              Jul 21 '15 at 0:48






            • 20





              Don't forget to run apt-get update first.

              – AVProgrammer
              Sep 4 '16 at 0:02











            • Before running 'apt-get install vim', you need to run 'apt-get update'.

              – user1521213
              Sep 26 '18 at 12:59















            30














            Your container probably haven't installed it out of the box.



            Run apt-get install vim in the terminal and you should be ready to go.






            share|improve this answer


















            • 2





              Yep, but I prefer vim-tiny (Ubuntu)

              – Ben Whaley
              Jul 21 '15 at 0:48






            • 20





              Don't forget to run apt-get update first.

              – AVProgrammer
              Sep 4 '16 at 0:02











            • Before running 'apt-get install vim', you need to run 'apt-get update'.

              – user1521213
              Sep 26 '18 at 12:59













            30












            30








            30







            Your container probably haven't installed it out of the box.



            Run apt-get install vim in the terminal and you should be ready to go.






            share|improve this answer













            Your container probably haven't installed it out of the box.



            Run apt-get install vim in the terminal and you should be ready to go.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 20 '15 at 12:52









            EnglundEnglund

            889612




            889612







            • 2





              Yep, but I prefer vim-tiny (Ubuntu)

              – Ben Whaley
              Jul 21 '15 at 0:48






            • 20





              Don't forget to run apt-get update first.

              – AVProgrammer
              Sep 4 '16 at 0:02











            • Before running 'apt-get install vim', you need to run 'apt-get update'.

              – user1521213
              Sep 26 '18 at 12:59












            • 2





              Yep, but I prefer vim-tiny (Ubuntu)

              – Ben Whaley
              Jul 21 '15 at 0:48






            • 20





              Don't forget to run apt-get update first.

              – AVProgrammer
              Sep 4 '16 at 0:02











            • Before running 'apt-get install vim', you need to run 'apt-get update'.

              – user1521213
              Sep 26 '18 at 12:59







            2




            2





            Yep, but I prefer vim-tiny (Ubuntu)

            – Ben Whaley
            Jul 21 '15 at 0:48





            Yep, but I prefer vim-tiny (Ubuntu)

            – Ben Whaley
            Jul 21 '15 at 0:48




            20




            20





            Don't forget to run apt-get update first.

            – AVProgrammer
            Sep 4 '16 at 0:02





            Don't forget to run apt-get update first.

            – AVProgrammer
            Sep 4 '16 at 0:02













            Before running 'apt-get install vim', you need to run 'apt-get update'.

            – user1521213
            Sep 26 '18 at 12:59





            Before running 'apt-get install vim', you need to run 'apt-get update'.

            – user1521213
            Sep 26 '18 at 12:59











            10














            The command to run depends on what base image you are using.



            For Alpine, vi is installed as part of the base OS. Installing vim would be:



            apk -U add vim


            For Debian and Ubuntu:



            apt-get update && apt-get install -y vim


            For CentOS, vi is usually installed with the base OS. For vim:



            yum install -y vim


            This should only be done in early development. Once you get a working container, the changes to files should be made to your image or configs stored outside of your container. Update your Dockerfile and other files it uses to build a new image. This certainly shouldn't be done in production since changes inside the container are by design ephemeral and will be lost when the container is replaced.






            share|improve this answer



























              10














              The command to run depends on what base image you are using.



              For Alpine, vi is installed as part of the base OS. Installing vim would be:



              apk -U add vim


              For Debian and Ubuntu:



              apt-get update && apt-get install -y vim


              For CentOS, vi is usually installed with the base OS. For vim:



              yum install -y vim


              This should only be done in early development. Once you get a working container, the changes to files should be made to your image or configs stored outside of your container. Update your Dockerfile and other files it uses to build a new image. This certainly shouldn't be done in production since changes inside the container are by design ephemeral and will be lost when the container is replaced.






              share|improve this answer

























                10












                10








                10







                The command to run depends on what base image you are using.



                For Alpine, vi is installed as part of the base OS. Installing vim would be:



                apk -U add vim


                For Debian and Ubuntu:



                apt-get update && apt-get install -y vim


                For CentOS, vi is usually installed with the base OS. For vim:



                yum install -y vim


                This should only be done in early development. Once you get a working container, the changes to files should be made to your image or configs stored outside of your container. Update your Dockerfile and other files it uses to build a new image. This certainly shouldn't be done in production since changes inside the container are by design ephemeral and will be lost when the container is replaced.






                share|improve this answer













                The command to run depends on what base image you are using.



                For Alpine, vi is installed as part of the base OS. Installing vim would be:



                apk -U add vim


                For Debian and Ubuntu:



                apt-get update && apt-get install -y vim


                For CentOS, vi is usually installed with the base OS. For vim:



                yum install -y vim


                This should only be done in early development. Once you get a working container, the changes to files should be made to your image or configs stored outside of your container. Update your Dockerfile and other files it uses to build a new image. This certainly shouldn't be done in production since changes inside the container are by design ephemeral and will be lost when the container is replaced.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 4 '18 at 14:12









                BMitchBMitch

                65.6k10142161




                65.6k10142161





















                    3














                    Add the following line in your Dockerfile then rebuild the docker image.



                    RUN apt-get update && apt-get install -y vim





                    share|improve this answer





























                      3














                      Add the following line in your Dockerfile then rebuild the docker image.



                      RUN apt-get update && apt-get install -y vim





                      share|improve this answer



























                        3












                        3








                        3







                        Add the following line in your Dockerfile then rebuild the docker image.



                        RUN apt-get update && apt-get install -y vim





                        share|improve this answer















                        Add the following line in your Dockerfile then rebuild the docker image.



                        RUN apt-get update && apt-get install -y vim






                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Jan 24 at 14:41









                        Brian Tompsett - 汤莱恩

                        4,2421339102




                        4,2421339102










                        answered Jan 24 at 14:12









                        CJ ChangCJ Chang

                        313




                        313





















                            2














                            Alternatively, keep your docker images small by not installing unnecessary editors. You can edit the files over ssh from the docker host to the container:



                            vim scp://remoteuser@container-ip//path/to/document





                            share|improve this answer



























                              2














                              Alternatively, keep your docker images small by not installing unnecessary editors. You can edit the files over ssh from the docker host to the container:



                              vim scp://remoteuser@container-ip//path/to/document





                              share|improve this answer

























                                2












                                2








                                2







                                Alternatively, keep your docker images small by not installing unnecessary editors. You can edit the files over ssh from the docker host to the container:



                                vim scp://remoteuser@container-ip//path/to/document





                                share|improve this answer













                                Alternatively, keep your docker images small by not installing unnecessary editors. You can edit the files over ssh from the docker host to the container:



                                vim scp://remoteuser@container-ip//path/to/document






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Apr 21 '17 at 17:22









                                MatthewMatthew

                                3,66482948




                                3,66482948





















                                    2














                                    To install within your Docker container you can run command




                                    docker exec apt-get update && apt-get install -y vim




                                    But this will be limited to the container in which vim is installed.
                                    To make it available to all the containers, edit the Dockerfile and add




                                    RUN apt-get update && apt-get install -y vim




                                    or you can also extend the image in the new Dockerfile and add above command. Eg.




                                    FROM < image name >



                                    RUN apt-get update && apt-get install -y vim







                                    share|improve this answer



























                                      2














                                      To install within your Docker container you can run command




                                      docker exec apt-get update && apt-get install -y vim




                                      But this will be limited to the container in which vim is installed.
                                      To make it available to all the containers, edit the Dockerfile and add




                                      RUN apt-get update && apt-get install -y vim




                                      or you can also extend the image in the new Dockerfile and add above command. Eg.




                                      FROM < image name >



                                      RUN apt-get update && apt-get install -y vim







                                      share|improve this answer

























                                        2












                                        2








                                        2







                                        To install within your Docker container you can run command




                                        docker exec apt-get update && apt-get install -y vim




                                        But this will be limited to the container in which vim is installed.
                                        To make it available to all the containers, edit the Dockerfile and add




                                        RUN apt-get update && apt-get install -y vim




                                        or you can also extend the image in the new Dockerfile and add above command. Eg.




                                        FROM < image name >



                                        RUN apt-get update && apt-get install -y vim







                                        share|improve this answer













                                        To install within your Docker container you can run command




                                        docker exec apt-get update && apt-get install -y vim




                                        But this will be limited to the container in which vim is installed.
                                        To make it available to all the containers, edit the Dockerfile and add




                                        RUN apt-get update && apt-get install -y vim




                                        or you can also extend the image in the new Dockerfile and add above command. Eg.




                                        FROM < image name >



                                        RUN apt-get update && apt-get install -y vim








                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Jan 5 '18 at 17:37









                                        MB11MB11

                                        144111




                                        144111





















                                            0














                                            Inside container(in docker, not in VM), by default these are not installed.
                                            Even apt-get, wget will not work. My VM is running on Ubuntu 17.10. For me yum package manaager worked.



                                            Yum is not part of debian or ubuntu. It is part of red-hat. But, it works in Ubuntu and it is installed by default like apt-get



                                            Tu install vim, use this command



                                            yum install -y vim-enhanced 


                                            To uninstall



                                            yum install -y vim-enhanced 


                                            Similarly,



                                            yum install -y wget 
                                            yum install -y sudo


                                            -y is for assuming yes if prompted for any qustion asked after doing yum install packagename






                                            share|improve this answer



























                                              0














                                              Inside container(in docker, not in VM), by default these are not installed.
                                              Even apt-get, wget will not work. My VM is running on Ubuntu 17.10. For me yum package manaager worked.



                                              Yum is not part of debian or ubuntu. It is part of red-hat. But, it works in Ubuntu and it is installed by default like apt-get



                                              Tu install vim, use this command



                                              yum install -y vim-enhanced 


                                              To uninstall



                                              yum install -y vim-enhanced 


                                              Similarly,



                                              yum install -y wget 
                                              yum install -y sudo


                                              -y is for assuming yes if prompted for any qustion asked after doing yum install packagename






                                              share|improve this answer

























                                                0












                                                0








                                                0







                                                Inside container(in docker, not in VM), by default these are not installed.
                                                Even apt-get, wget will not work. My VM is running on Ubuntu 17.10. For me yum package manaager worked.



                                                Yum is not part of debian or ubuntu. It is part of red-hat. But, it works in Ubuntu and it is installed by default like apt-get



                                                Tu install vim, use this command



                                                yum install -y vim-enhanced 


                                                To uninstall



                                                yum install -y vim-enhanced 


                                                Similarly,



                                                yum install -y wget 
                                                yum install -y sudo


                                                -y is for assuming yes if prompted for any qustion asked after doing yum install packagename






                                                share|improve this answer













                                                Inside container(in docker, not in VM), by default these are not installed.
                                                Even apt-get, wget will not work. My VM is running on Ubuntu 17.10. For me yum package manaager worked.



                                                Yum is not part of debian or ubuntu. It is part of red-hat. But, it works in Ubuntu and it is installed by default like apt-get



                                                Tu install vim, use this command



                                                yum install -y vim-enhanced 


                                                To uninstall



                                                yum install -y vim-enhanced 


                                                Similarly,



                                                yum install -y wget 
                                                yum install -y sudo


                                                -y is for assuming yes if prompted for any qustion asked after doing yum install packagename







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Mar 8 at 5:08









                                                P Satish PatroP Satish Patro

                                                7310




                                                7310



























                                                    draft saved

                                                    draft discarded
















































                                                    Thanks for contributing an answer to Stack Overflow!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid


                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.

                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function ()
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31515863%2fhow-to-run-vi-on-docker-container%23new-answer', 'question_page');

                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                                                    2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

                                                    Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme