Ubuntu18.04基礎安裝

pengjielee發表於2019-10-29

Ubuntu18.04基礎安裝

安裝Nodejs

$ sudo apt-get install curl
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt install nodejs
$ node -v
$ npm -v
複製程式碼

安裝Yarn

$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
$ sudo apt update && sudo apt install yarn
$ yarn --version
複製程式碼

安裝MySql

$ sudo apt install mysql-server
$ sudo mysql
$ ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
$ quit

or 
$ sudo mysql_secure_installation
複製程式碼

安裝nvm

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
$ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
$ nvm --version
複製程式碼

安裝Mongodb

$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
$ echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
$ sudo apt-get update
$ sudo apt-get install -y mongodb-org=4.2.1 mongodb-org-server=4.2.1 mongodb-org-shell=4.2.1 mongodb-org-mongos=4.2.1 mongodb-org-tools=4.2.1
複製程式碼

管理Mongodb

$ sudo service mongod start
$ sudo service mongod stop
$ sudo service mongod status
$ sudo service mongod restart
複製程式碼

安裝Git

$ sudo apt-get install git
複製程式碼

安裝unzip

$ wget https://ghost.org/zip/ghost-latest.zip
$ apt install unzip
$ mkdir ghost
$ unzip ghost-latest.zip -d ./ghost
複製程式碼

安裝pm2

$ npm install pm2 -g

or

$ yarn global add pm2
複製程式碼

參考

yarnpkg.com/en/docs/ins…
github.com/nvm-sh/nvm#…
docs.mongodb.com/manual/tuto… git-scm.com/download/li…

相關文章