DEV Community

loading...

Fedora Workstation 34: Guia pós-instalação e Ambiente Dev JavaScript

Thiago Reis
Dev Javascript, .Net, React.js, Vue.js
Updated on ・4 min read

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:

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
Enter fullscreen mode Exit fullscreen mode

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

2 - Repositórios RPM Fusion

Free:

sudo rpm -Uvh https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm 
Enter fullscreen mode Exit fullscreen mode

Non-free:

sudo rpm -Uvh https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm 
Enter fullscreen mode Exit fullscreen mode

3 - Atualizar o sistema

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 
Enter fullscreen mode Exit fullscreen mode

4 – Instalar Codecs Multimidia

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 
Enter fullscreen mode Exit fullscreen mode

5 – Instalar Fontes Microsoft

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 
Enter fullscreen mode Exit fullscreen mode

5 - Extensões do Gnome e melhorias

sudo dnf install -y gnome-extensions-app gnome-tweaks 
sudo dnf install -y gnome-shell-extension-appindicator 
Enter fullscreen mode Exit fullscreen mode

6 – Suporte a pacotes Snap

sudo dnf install -y snapd
sudo ln -s /var/lib/snapd/snap /snap # for classic snap support
(Necessário reiniciar o sistema) 
Enter fullscreen mode Exit fullscreen mode

Ambiente Dev

7 – Fontes adicionais

sudo dnf install -y fira-code-fonts 'mozilla-fira*' 'google-roboto*' 
Enter fullscreen mode Exit fullscreen mode

8 – Ferramentas essenciais

sudo dnf groupinstall "Development Tools"
udo dnf install util-linux-user 
Enter fullscreen mode Exit fullscreen mode

9 – Visual Studio Code

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 
Enter fullscreen mode Exit fullscreen mode

10 – Configurar terminal com Oh-my-zsh + spaceship

sudo dnf install zsh 
Enter fullscreen mode Exit fullscreen mode

Instalando o Oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Tema Spaceship

git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" 
Enter fullscreen mode Exit fullscreen mode
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" 
Enter fullscreen mode Exit fullscreen mode

Após criar o alias, vamos editar o arquivo ~/.zshrc e mudar a diretiva do tema:

ZSH_THEME="spaceship" 
Enter fullscreen mode Exit fullscreen mode

Screenshot from 2021-05-29 09-05-09
E no final do arquivo vamos acrescentar algumas configurações extras do spaceship:

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=" "

Enter fullscreen mode Exit fullscreen mode

Screenshot from 2021-05-29 09-06-37

Plugins do ZSH

Vamos utilizar o Zinit para facilitar a instalação dos plugins do ZSH:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)" 
Enter fullscreen mode Exit fullscreen mode

Após a instalação basta acrescentar as seguintes linhas no final do arquivo ~/.zshrc:

zinit light zdharma/fast-syntax-highlighting 
zinit light zsh-users/zsh-autosuggestions 
zinit light zsh-users/zsh-completions 
Enter fullscreen mode Exit fullscreen mode

Se após fechar e abrir o terminal o zsh não estiver como padrão, execute o seguinte comando para alterar o shell:

chsh -s $(which zsh) 
Enter fullscreen mode Exit fullscreen mode

NodeJS usando NVM

Vamos fazer a instalação do NodeJS usando NVM utilizando o seguinte comando:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Após a instalação é preciso acrescentar o export das variáveis de ambiente do NVM ao final do arquivo ~/.zshrc:

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

Enter fullscreen mode Exit fullscreen mode

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

source ~/.zshrc 
Enter fullscreen mode Exit fullscreen mode

Instalando o NodeJS

nvm install 14 
Enter fullscreen mode Exit fullscreen mode

alt text

Discussion (0)