Table des matières

FreeBSD post-install


How To BSD
Services réseaux
Services X


Connaître


- la version de freebsd

freebsd-version

- la version du noyau

uname -a


Configuration du clavier


La commande en cli :

kbdmap


Réglage de pkg


Mettre la commande pkg à yes pour ne pas à chaque fois confirmer

vi /usr/local/etc/pkg.conf
ASSUME_ALWAYS_YES = true;



UPDATE & UPGRADE


Mettre à jour la version


freebsd-update fetch
freebsd-update install

;-)

Mettre à jour vers une version supérieur


Exemple: j'ai une version 12.0 et je veux passer sur une 12.1

freebsd-update -r 12.1-RELEASE upgrade

src component not installed, skipped
Looking up update.FreeBSD.org mirrors... none found.
Fetching metadata signature for 12.0-RELEASE from update.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic kernel/generic-dbg world/base world/doc world/lib32

The following components of FreeBSD do not seem to be installed:
world/base-dbg world/lib32-dbg

Does this look reasonable (y/n)? y

Fetching metadata signature for 12.1-RELEASE from update.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 12.0-RELEASE for merging... done.
Preparing to download files... done.
Fetching 10450 patches.....10....20....30....
10450 done.
Applying patches...
The following files will be removed as part of updating to 12.1-RELEASE-p0:
freebsd-update install
src component not installed, skipped
Installing updates...
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
reboot
uname -a
FreeBSD fbsd-1 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64
freebsd-update install
src component not installed, skipped
Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.
reboot
freebsd-update install
src component not installed, skipped
Installing updates... done.

;-)

Démarrage des services & outils


Configure /etc/rc.conf


A la fin de l'installation sysinstall demande de coché certaines options, j'ai activé:

Après l'installe on se retrouve donc avec ce type de fichier, c'est le rc.conf qui contient la configuration:

nano /etc/rc.conf
hostname="fbsd"
keymap="be.iso.kbd"
ifconfig_nfe0="inet 192.168.1.6 netmask 255.255.255.0"
defaultrouter="192.168.1.254"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"


Installation des outils


- installation d'outils de base pour le mode terminal:

pkg install bash nano mc


Bash

- bash requires fdescfs(5) mounted on /dev/fd donc pour l'utiliser tout de suite:

mount -t fdescfs fdesc /dev/fd

- pour que ce soit permanent on ajoute dans /etc/fstab:

nano /etc/fstab
fdesc    /dev/fd    fdescfs    rw  0 0

A partir de FreeBSD 12 plus besoin de modifier /etc/fstab !

- on verifie ensuite le type de shell par défaut:

echo $SHELL
/bin/csh

- on change le shell pour utiliser celui que l'on veut:

chsh -s /usr/local/bin/bash aiko

- pour voir tout on peut relancer:

chsh

- on se delog puis on se relog et on a notre Shell par défaut

Activation de l'autocomplétion

Install bash-completion on FreeBSD 12

pkg install bash-completion

=====
Message from bash-completion-2.9,2:

--
To enable the bash completion library, add the following to
your .bashrc file:

[[ $PS1 && -f /usr/local/share/bash-completion/bash_completion.sh ]] && \
	source /usr/local/share/bash-completion/bash_completion.sh

See /usr/local/share/doc/bash-completion/README.md for more information.

- on active l'autocomplétion on ajoute ces lignes dans ~/.profile mais dans .bashrc ça fonctionne beaucoup mieux !

[[ $PS1 && -f /usr/local/share/bash-completion/bash_completion.sh ]] && \
	source /usr/local/share/bash-completion/bash_completion.sh

Variables d'environnements

- voir ses variables environnements avec env permet d'avoir une vue d'ensemble de tout la config d'un utilisateur:

env

- avoir les pages man en français:

pkg install fr-freebsd-doc

- on fait un locate.updatedb qui nous permettra de rechercher n'importe quel fichier avec locate:

/usr/libexec/locate.updatedb
locate ls (pour test)

- diminuer le temps au boot

vim /boot/loader.conf
autoboot_delay="0"



SED


SED FeeBSD

Supprime le premier caractère des lignes 35 à 41
sed -i '35,41 {s/^#//g}' bash.bashrc



How To BSD]
Services réseaux
Services X