0

I wanted to automate installation of pycharm on my new Linux Mint 19.1 and everything works great until I use sudo move command. Whenever code goes to that line I get "sudo: move: command not found" error. I don't know what's wrong. I tried to follow tutorial here:

https://www.danieblog.com/technology/software/how-to-install-pycharm-community-in-linux-mint-72.html

My code below:

#!/usr/bin/python3.6
import platform
import os
import time

pycharm_version = 'pycharm-community-2018.3.5'
filename = pycharm_version + '.tar.gz'
pycharm_link = 'https://download.jetbrains.com/python/' + filename

if platform.system().lower() == 'linux':
    command = 'wget {}'.format(pycharm_link)
    print(command)
    os.system(command)    
    command = 'tar xvaf {}'.format(filename)
    print(command)    
    time.sleep(1)
    os.system(command)
    time.sleep(1)
    command = 'sudo move /home/user/{} /opt/pycharm'.format(pycharm_version)
    print(command)
    os.system(command)
  • 1
    move -> mv ? – steve Mar 4 '19 at 22:36
  • 1
    Did you mean mv? – Kusalananda Mar 4 '19 at 22:38
  • 3
    The tutorial is incorrect, and wrongly uses move instead of mv. But i don't understand why you're wrapping the shell commands in a python script. That makes little sense. – roaima Mar 4 '19 at 23:01
  • That explains a lot. I wrap everything into python script so I could make cross platform installation file. – Gunnm Mar 5 '19 at 7:51
2

It should be

sudo mv /home/user/{} /opt/pycharm

as mentioned in comments above this can be implemented in shell script much more simply.

  • 1
    Yeah I'm new to Linux so I'm not familiar with terminal commands. Didn't suspect that tutorial could be wrong. Thanks for help. – Gunnm Mar 5 '19 at 7:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.