Command not found after installing p7zip

16,204

Solution 1

figured it out!

the path in the bin file was pointing to the wrong place.

i needed to switch the direction from the

usr/local/lib/p7zip/ 

directory to

usr/lib/p7zip/

directory....

Solution 2

p7zip isn't enough, also had to install p7zip-plugins ... then it's /bin/7z.

Share:
16,204

Related videos on Youtube

Amadeobee
Author by

Amadeobee

Updated on September 18, 2022

Comments

  • Amadeobee
    Amadeobee over 1 year

    Just getting started with Linux/Ubuntu. I installed 7z but the command is not found. I restarted the computer to hopefully refresh commands but that didn't help either.

    Here is what I did:

    sudo apt-get install p7zip
    sudo apt-get install p7zip-full
    

    Then tried

    7z e [file-name].xz
    

    and

    7za e [file-name].xz
    

    then I read up the man file but still nothing. Every time i get the following reply:

    /usr/local/bin/7z: 2: /usr/local/bin/7z: /usr/local/lib/p7zip/7z: not found
    
    • posfan12
      posfan12 over 5 years
      I get the same error, except that I am trying to execute 7za instead of 7z. I have checked, and the files are located in the correct directories AFAIK. Do I need to reboot before these changes take effect?
  • dessert
    dessert almost 6 years
    Glad you solved the problem! What do you mean with “switched the direction”? Do you mean the shell script /usr/bin/7z contained exec /usr/local/lib/p7zip/7z "$@" instead of exec /usr/lib/p7zip/7z "$@"? If so, that’s a major issue justifying a bug report I think. I can’t confirm for the repo packages of 16.04 and 18.04 – what release do you use? Please add this information to your question (edit).
  • steeldriver
    steeldriver almost 6 years
    The real problem seems to be that you have a 7z in /usr/local/bin that is unrelated to the packages that you installed via apt, but is being run preferentially because of the order of your PATH
  • Amadeobee
    Amadeobee almost 6 years
    I seem to have many 7z's around the computer, one on local and then a general one. I am not exactly sure how the installation system works if I install a program with sudo apt-get and if it depends where I currently am in the file structure... I originally downloaded it from the sourceforge sight, then after that didnt work I used apt-get.
  • Amadeobee
    Amadeobee almost 6 years
    I would appreciate it if either of you could point me in the direction of a book or source of reading where I can better understand how to navigate through local vs home vs usr when installing files and where the bash files end up (or is that dictated by the installation file and not where I am? ) again - thanks for the help!
  • Amadeobee
    Amadeobee almost 6 years
    @dessert - the version that I downloaded from source forge was 16.02 but with the apt-get I am not sure (and actually am not sure how to find the version) doing 7z --version isnt working..
  • Admin
    Admin almost 2 years
    This fixed the issue for me