Fedora Workstation 34: Guia pós-instalação e Ambiente Dev JavaScript
Tags: linux, javascript, braziliandevs
Published: 2021-05-29 18:17:50

O intuito deste post é apresentar o essencial a se fazer após a instalação do Fedora Workstation 34 e de bônus a configuração de um ambiente essencial de desenvolvimento JavaScript.

## 1 - Habilitar os Mirrors mais rápidos
Vamos editar o arquivo /etc/dnf/dnf.conf e habilitar os mirrors mais rápidos e aumentar a quantidade de downloads paralelos. Execute os seguintes comandos no terminal:
```shell
sudo echo 'fastestmirror=1' | sudo tee -a /etc/dnf/dnf.conf 
sudo echo 'max_parallel_downloads=10' | sudo tee -a /etc/dnf/dnf.conf 
sudo echo 'deltarpm=true' | sudo tee -a /etc/dnf/dnf.conf
```
Os 3 comandos acima irão adicionar as diretivas fastestmirror, max_parallel_downloads e deltarpm ao arquivo:
![Screenshot from 2021-05-29 07-21-01](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7ve9hwg8d3kvhk8lsqg.png)
## 2 - Repositórios RPM Fusion
 Free:
```shell
sudo rpm -Uvh https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm 
```
Non-free:
```shell
sudo rpm -Uvh https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm 
```
## 3 - Atualizar o sistema
```shell
sudo dnf upgrade
sudo dnf upgrade --refresh
sudo dnf groupupdate core
sudo dnf install -y rpmfusion-free-release-tainted
sudo dnf install -y dnf-plugins-core 
```
## 4 – Instalar Codecs Multimidia 

```shell
sudo dnf install amrnb amrwb faad2 flac ffmpeg gpac-libs lame libfc14audiodecoder mencoder mplayer x264 x265 gstreamer-plugins-espeak gstreamer-plugins-bad gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-plugins-base gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good 
```
## 5 – Instalar Fontes Microsoft 

```shell
sudo dnf install curl cabextract xorg-x11-font-utils fontconfig 

sudo rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm 
```
## 5 - Extensões do Gnome e melhorias 

```shell
sudo dnf install -y gnome-extensions-app gnome-tweaks 
sudo dnf install -y gnome-shell-extension-appindicator 
```
## 6 – Suporte a pacotes Snap 

```shell
sudo dnf install -y snapd
sudo ln -s /var/lib/snapd/snap /snap # for classic snap support
(Necessário reiniciar o sistema) 
```
# Ambiente Dev
## 7 – Fontes adicionais 
```shell
sudo dnf install -y fira-code-fonts 'mozilla-fira*' 'google-roboto*' 
```
## 8 – Ferramentas essenciais 

```shell
sudo dnf groupinstall "Development Tools"
sudo dnf install util-linux-user 
```
## 9 – Visual Studio Code 
```shell
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc 
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' 
sudo dnf check-update 
sudo dnf install code 
```
## 10 – Configurar terminal com Oh-my-zsh + spaceship 

```shell
sudo dnf install zsh 
```
#### Instalando o Oh-my-zsh

```shell
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
#### Tema Spaceship

```shell
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" 
```

```shell
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" 
```
Após criar o alias, vamos editar o arquivo ~/.zshrc e mudar a diretiva do tema:
```shell
ZSH_THEME="spaceship" 
```
![Screenshot from 2021-05-29 09-05-09](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utghajxt3wzi9atuvufv.png)
 E no final do arquivo vamos acrescentar algumas configurações extras do spaceship: 

```shell
SPACESHIP_PROMPT_ORDER=(
  user          # Username section
  dir           # Current directory section
  host          # Hostname section
  git           # Git section (git_branch + git_status)
  hg            # Mercurial section (hg_branch  + hg_status)
  exec_time     # Execution time
  line_sep      # Line break
  vi_mode       # Vi-mode indicator
  jobs          # Background jobs indicator
  exit_code     # Exit code section
  char          # Prompt character
  node          # Node version
)
SPACESHIP_USER_SHOW=always
SPACESHIP_PROMPT_ADD_NEWLINE=false
SPACESHIP_CHAR_SYMBOL="❯"
SPACESHIP_CHAR_SUFFIX=" "

```
![Screenshot from 2021-05-29 09-06-37](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezabf805t137c71jc3q5.png)
#### Plugins do ZSH 
Vamos utilizar o Zinit para facilitar a instalação dos plugins do ZSH: 
```shell
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
```
Após a instalação basta acrescentar as seguintes linhas no final do arquivo ~/.zshrc: 

```shell
zinit light zdharma-continuum/fast-syntax-highlighting 
zinit light zsh-users/zsh-autosuggestions 
zinit light zsh-users/zsh-completions 
```
Se após fechar e abrir o terminal o zsh não estiver como padrão, execute o seguinte comando para alterar o shell:
```shell
chsh -s $(which zsh) 
```
## NodeJS usando NVM
Vamos fazer a instalação do NodeJS usando NVM utilizando o seguinte comando:
```shell
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
```
Após a instalação é preciso acrescentar o export das variáveis de ambiente do NVM ao final do arquivo ~/.zshrc:
```shell
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

```
E para que o comando nvm fique disponível é preciso recarregar o arquivo zshrc utilizando o comando source:

```shell
source ~/.zshrc 
```
#### Instalando o NodeJS
```shell
nvm install 14 
```
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1sjfhry7ljjufy1ew3q9.png)