internal: refactor dependencies check and installations
internal: fix permission problem