-bash: /usr/bin/nano: No such file or directory

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I have this problem on fresh install of Debian 8 (after doing apt upgrade).



nano is installed but when I try to use it to open a file :



nano myfile.txt



I get:



-bash: /usr/bin/nano: No such file or directory


I removed and reinstalled nano I get:



Setting up nano (2.7.4-1) ...
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode


And using /usr/bin/editor myfile.txt I can open the file.



Why does this happen? How can I fix it?







share|improve this question













migrated from serverfault.com May 3 at 9:08


This question came from our site for system and network administrators.














  • ls -l /usr/bin/nano ls: cannot access '/usr/bin/nano': No such file or directory
    – Karlom
    May 3 at 9:22







  • 1




    What does type nano give you? Presumably Bash has hashed it under the wrong path. Have you tried logging on anew to see if this is limited to your shell instance?
    – 0xC0000022L
    May 3 at 9:47






  • 1




    Guys, for no obvious reason, nano command works now. As for type nano I get nano is hashed (/bin/nano). Really strange! I never had such issue before.
    – Karlom
    May 3 at 9:50











  • @StephenKitt Could you explain what is cause of the problem , please.
    – GAD3R
    May 3 at 10:03






  • 5




    @GAD3R nano used to include both /bin/nano and /usr/bin/nano (the latter as a symlink to the former). Going from Debian 8 to 9, nano dropped the symlink; upgrading the package would then result in the error in the question, until a new shell is started or hash -r is run.
    – Stephen Kitt
    May 3 at 11:06














up vote
1
down vote

favorite












I have this problem on fresh install of Debian 8 (after doing apt upgrade).



nano is installed but when I try to use it to open a file :



nano myfile.txt



I get:



-bash: /usr/bin/nano: No such file or directory


I removed and reinstalled nano I get:



Setting up nano (2.7.4-1) ...
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode


And using /usr/bin/editor myfile.txt I can open the file.



Why does this happen? How can I fix it?







share|improve this question













migrated from serverfault.com May 3 at 9:08


This question came from our site for system and network administrators.














  • ls -l /usr/bin/nano ls: cannot access '/usr/bin/nano': No such file or directory
    – Karlom
    May 3 at 9:22







  • 1




    What does type nano give you? Presumably Bash has hashed it under the wrong path. Have you tried logging on anew to see if this is limited to your shell instance?
    – 0xC0000022L
    May 3 at 9:47






  • 1




    Guys, for no obvious reason, nano command works now. As for type nano I get nano is hashed (/bin/nano). Really strange! I never had such issue before.
    – Karlom
    May 3 at 9:50











  • @StephenKitt Could you explain what is cause of the problem , please.
    – GAD3R
    May 3 at 10:03






  • 5




    @GAD3R nano used to include both /bin/nano and /usr/bin/nano (the latter as a symlink to the former). Going from Debian 8 to 9, nano dropped the symlink; upgrading the package would then result in the error in the question, until a new shell is started or hash -r is run.
    – Stephen Kitt
    May 3 at 11:06












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have this problem on fresh install of Debian 8 (after doing apt upgrade).



nano is installed but when I try to use it to open a file :



nano myfile.txt



I get:



-bash: /usr/bin/nano: No such file or directory


I removed and reinstalled nano I get:



Setting up nano (2.7.4-1) ...
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode


And using /usr/bin/editor myfile.txt I can open the file.



Why does this happen? How can I fix it?







share|improve this question













I have this problem on fresh install of Debian 8 (after doing apt upgrade).



nano is installed but when I try to use it to open a file :



nano myfile.txt



I get:



-bash: /usr/bin/nano: No such file or directory


I removed and reinstalled nano I get:



Setting up nano (2.7.4-1) ...
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode


And using /usr/bin/editor myfile.txt I can open the file.



Why does this happen? How can I fix it?









share|improve this question












share|improve this question




share|improve this question








edited May 3 at 12:57









Stephen Kitt

140k22302363




140k22302363









asked May 3 at 8:52









Karlom

1083




1083




migrated from serverfault.com May 3 at 9:08


This question came from our site for system and network administrators.






migrated from serverfault.com May 3 at 9:08


This question came from our site for system and network administrators.













  • ls -l /usr/bin/nano ls: cannot access '/usr/bin/nano': No such file or directory
    – Karlom
    May 3 at 9:22







  • 1




    What does type nano give you? Presumably Bash has hashed it under the wrong path. Have you tried logging on anew to see if this is limited to your shell instance?
    – 0xC0000022L
    May 3 at 9:47






  • 1




    Guys, for no obvious reason, nano command works now. As for type nano I get nano is hashed (/bin/nano). Really strange! I never had such issue before.
    – Karlom
    May 3 at 9:50











  • @StephenKitt Could you explain what is cause of the problem , please.
    – GAD3R
    May 3 at 10:03






  • 5




    @GAD3R nano used to include both /bin/nano and /usr/bin/nano (the latter as a symlink to the former). Going from Debian 8 to 9, nano dropped the symlink; upgrading the package would then result in the error in the question, until a new shell is started or hash -r is run.
    – Stephen Kitt
    May 3 at 11:06
















  • ls -l /usr/bin/nano ls: cannot access '/usr/bin/nano': No such file or directory
    – Karlom
    May 3 at 9:22







  • 1




    What does type nano give you? Presumably Bash has hashed it under the wrong path. Have you tried logging on anew to see if this is limited to your shell instance?
    – 0xC0000022L
    May 3 at 9:47






  • 1




    Guys, for no obvious reason, nano command works now. As for type nano I get nano is hashed (/bin/nano). Really strange! I never had such issue before.
    – Karlom
    May 3 at 9:50











  • @StephenKitt Could you explain what is cause of the problem , please.
    – GAD3R
    May 3 at 10:03






  • 5




    @GAD3R nano used to include both /bin/nano and /usr/bin/nano (the latter as a symlink to the former). Going from Debian 8 to 9, nano dropped the symlink; upgrading the package would then result in the error in the question, until a new shell is started or hash -r is run.
    – Stephen Kitt
    May 3 at 11:06















ls -l /usr/bin/nano ls: cannot access '/usr/bin/nano': No such file or directory
– Karlom
May 3 at 9:22





ls -l /usr/bin/nano ls: cannot access '/usr/bin/nano': No such file or directory
– Karlom
May 3 at 9:22





1




1




What does type nano give you? Presumably Bash has hashed it under the wrong path. Have you tried logging on anew to see if this is limited to your shell instance?
– 0xC0000022L
May 3 at 9:47




What does type nano give you? Presumably Bash has hashed it under the wrong path. Have you tried logging on anew to see if this is limited to your shell instance?
– 0xC0000022L
May 3 at 9:47




1




1




Guys, for no obvious reason, nano command works now. As for type nano I get nano is hashed (/bin/nano). Really strange! I never had such issue before.
– Karlom
May 3 at 9:50





Guys, for no obvious reason, nano command works now. As for type nano I get nano is hashed (/bin/nano). Really strange! I never had such issue before.
– Karlom
May 3 at 9:50













@StephenKitt Could you explain what is cause of the problem , please.
– GAD3R
May 3 at 10:03




@StephenKitt Could you explain what is cause of the problem , please.
– GAD3R
May 3 at 10:03




5




5




@GAD3R nano used to include both /bin/nano and /usr/bin/nano (the latter as a symlink to the former). Going from Debian 8 to 9, nano dropped the symlink; upgrading the package would then result in the error in the question, until a new shell is started or hash -r is run.
– Stephen Kitt
May 3 at 11:06




@GAD3R nano used to include both /bin/nano and /usr/bin/nano (the latter as a symlink to the former). Going from Debian 8 to 9, nano dropped the symlink; upgrading the package would then result in the error in the question, until a new shell is started or hash -r is run.
– Stephen Kitt
May 3 at 11:06










1 Answer
1






active

oldest

votes

















up vote
6
down vote













In Debian 8, nano includes both /bin/nano and /usr/bin/nano (the latter is a symlink to the former). In Debian 9, /usr/bin/nano is no longer included (see #767929 for details).



Presumably you upgraded from Debian 8 to a version of the package including the fix above. Your shell had remembered that nano was in /usr/bin/nano, but after the upgrade that was no longer the case. Running hash -r in your shell would fix that, as would starting a new shell.






share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441493%2fbash-usr-bin-nano-no-such-file-or-directory%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    6
    down vote













    In Debian 8, nano includes both /bin/nano and /usr/bin/nano (the latter is a symlink to the former). In Debian 9, /usr/bin/nano is no longer included (see #767929 for details).



    Presumably you upgraded from Debian 8 to a version of the package including the fix above. Your shell had remembered that nano was in /usr/bin/nano, but after the upgrade that was no longer the case. Running hash -r in your shell would fix that, as would starting a new shell.






    share|improve this answer

























      up vote
      6
      down vote













      In Debian 8, nano includes both /bin/nano and /usr/bin/nano (the latter is a symlink to the former). In Debian 9, /usr/bin/nano is no longer included (see #767929 for details).



      Presumably you upgraded from Debian 8 to a version of the package including the fix above. Your shell had remembered that nano was in /usr/bin/nano, but after the upgrade that was no longer the case. Running hash -r in your shell would fix that, as would starting a new shell.






      share|improve this answer























        up vote
        6
        down vote










        up vote
        6
        down vote









        In Debian 8, nano includes both /bin/nano and /usr/bin/nano (the latter is a symlink to the former). In Debian 9, /usr/bin/nano is no longer included (see #767929 for details).



        Presumably you upgraded from Debian 8 to a version of the package including the fix above. Your shell had remembered that nano was in /usr/bin/nano, but after the upgrade that was no longer the case. Running hash -r in your shell would fix that, as would starting a new shell.






        share|improve this answer













        In Debian 8, nano includes both /bin/nano and /usr/bin/nano (the latter is a symlink to the former). In Debian 9, /usr/bin/nano is no longer included (see #767929 for details).



        Presumably you upgraded from Debian 8 to a version of the package including the fix above. Your shell had remembered that nano was in /usr/bin/nano, but after the upgrade that was no longer the case. Running hash -r in your shell would fix that, as would starting a new shell.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered May 3 at 12:56









        Stephen Kitt

        140k22302363




        140k22302363






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441493%2fbash-usr-bin-nano-no-such-file-or-directory%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?