📑Langages

Setup pour langages de programmation sur Fedora

Python

sudo dnf install python3		# Installing Python 3
sudo dnf install -y python2		# Installing Python 2

# If you have both versions installed,
# and you have an app that expects a specific version,
# use this command to set the correct one in the system path:

sudo alternatives --set python /usr/bin/python3 # To set Python3 as the default
sudo alternatives --set python /usr/bin/python3 # To set Python2 as the default

PHP

sudo dnf install php-cli			# PHP Installation
sudo dnf install phpunit composer               # PHPUnit for unit tests or Composer to manage dependencies of PHP projects
sudo dnf install php-mysqli			# PHP modules
sudo php --server localhost:8080 --docroot  .	# PHP Development Server

Rust

Rust

sudo dnf install rust cargo

This will install the compiler (rustc), standard library, gdb support, documentation generator (rustdoc) and the package manager (cargo).

rustup

rustup est un installateur pour le langage de programmation Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

rustlings

Le projet rustlings contient de petits exercices pour vous habituer à lire et à écrire du code Rust. Cela inclut la lecture et la réponse aux messages du compilateur

# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.2.1)
git clone -b 5.2.1 --depth 1 https://github.com/rust-lang/rustlings
cd rustlings
cargo install --force --path .

Ruby

Dépendances

Avant d'installer Ruby, installons rbenv, un software qui installe et manage les environnements ruby. La première étape consiste à installer les dépendances pour Ruby.

sudo dnf install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel

rbenv

Maintenant installons rbenv

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec $SHELL

Ruby

Maintenant, nous sommes êtes prêt à installer ruby et à définir la version par défaut.

rbenv install 3.1.2    # Install ruby
rbenv global 3.1.2     # Define version to use by default
exec $SHELL            # Reset your terminal
ruby --version         # Check your Ruby version

Si le message commence par ruby 3.1.2p , continuez 👍

gems

Installons maintenant quelques gems 🤗

gem install bundler colored faker http pry-byebug rake rest-client rspec rubocop-performance sqlite3

Si vous préférez le faire gem par gem c'est possible 😎👍

gem install bundler                # Bundler             https://bundler.io/
gem install colored                # Colored             https://github.com/defunkt/colored
gem install faker                  # Faker               https://github.com/faker-ruby/faker
gem install http                   # http                https://github.com/httprb/http
gem install pry-byebug             # Pry-byebug          https://github.com/deivid-rodriguez/pry-byebug
gem install rake                   # Rake                https://github.com/ruby/rake
gem install rest-client            # Rest Client         https://github.com/rest-client/rest-client
gem install rspec                  # rspec               https://github.com/rspec/rspec-metagem
gem install rubocop-performance    # Rubocop-Performance https://github.com/rubocop/rubocop-performance
gem install sqlite3                # SQLite 3            https://github.com/sparklemotion/sqlite3-ruby

Si le message xx gems installed, s'affiche tout est bon 👍

N'installez JAMAIS une gemme avec sudo gem install! Même si vous tombez sur une réponse de Stackoverflow (ou le terminal) vous indiquant de le faire.

Bundler

sudo dnf install rubygem-bundler

La commande bundledevrait être ensuite disponible sur votre système.

Ruby on Rails

Description

Rails est le framework du langage Ruby

Installation avec RubyGems.org

Pré-requis : Pour installer Rails, vous devez d'abord avoir installer Ruby et les packages: ruby-devel, gcc, zlib-devel et ensuite installons rails en utilisant la gem

sudo dnf install rubygem-rails  	# Install Rubygem with RubyGems.org
sudo dnf group install 'Ruby on Rails'	# Install Rails framework

Flutter

Installation

sudo snap install flutter --classic	# Install Flutter using SnapStore
flutter sdk-path			# Display your Flutter SDK path

Node.JS

NodeJS

Démarrons l'installation avec cette commande

sudo dnf install nodejs

Lorsque l'installation est terminé, taper

node --version

Si le message affiche v16.15.1 ou autre version, vous pouvez continuer

nvm

nvm est manager de version de Node. Il fonctionne sur n'importe quel shell compatible POSIX (sh, dash, ksh, zsh, bash), en particulier sur les plateformes suivantes : UNIX, macOS, et windows WSL.

Installons nvm par le script d'installation

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bashbas

L'exécution de l'une des commandes ci-dessus télécharge un script et l'exécute. Le script clone le dépôt nvm dans /.nvm, et tente d'ajouter les lignes sources de l'extrait ci-dessous au bon fichier de profil (/.bash_profile, ~/.zshrc, ~/.profile, ou ~/.bashrc).

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Vérifier l'installation

command -v nvm

En cas de réussite, nvm devrait afficher.

yarn

Installons maintenant yarn, le gestionnaire de paquets pour installer des bibliothèques JavaScript.

sudo dnf install yarnpkg

Ensuite, exécutez la commande suivante :

yarn --version

Si le message affiche v1.22.17 ou autre version, vous pouvez continuer

npm

Installation de modules NPM

Pour installer des modules supplémentaires à partir des dépôts Fedora :

sudo dnf install 'npm(module-name)'       # Method 1
sudo dnf install nodejs-<module-name>     # Method 2

Source : https://developer.fedoraproject.org/tech/languages/nodejs/modules.html

Installation global modules

Créez un répertoire pour les installations globales dans votre répertoire personnel

mkdir ~/.npm-global

Définissez le nouveau chemin du répertoire pour npm

npm config set prefix '~/.npm-global'.

Ouvrez/créez le fichier ~/.profile et ajoutez la ligne suivante

export PATH=~/.npm-global/bin:$PATH

Mettez à jour vos variables système avec cette commande

source ~/.profile

JAVA

Gradle

Pré-requis : nécéssite le gestionnaire de paquet SDKMAN!

Installation de gradle

sdk install gradle 7.6

SDKMAN!

Installation via le gestionnaire de paquet SDKMAN!

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

Ensuite, exécutez la commande suivante :

sdk version

Si le message affiche v5.16.0 ou autre version, vous pouvez continuer

Dernière mise à jour