PERSONAL UBUNTU SET-UP
1. SYSTEM SET-UP
sudo apt update
sudo apt install xfce4
sudo apt install lightdm
1.1. Accented Characters
sudo apt install gnome-tweaks
- Applications → Paramètres → Gestionnaire de paramètres → Clavier → Layout → compose key → Right Ctrl
- Reboot
1.2. Customizing the Touch Pad
To avoid clicking on everything each time one uses the touch pad:
- Settings manager → mouse and touchpad → touchpad
- Unselect "Tap touchpad to click"
- Unselect "Reverse scroll direction"
1.3. Terminal
I make Tilix
my default terminal:
sudo apt install tilix
exo-preferred-applications
→ utilities → choose tilix- C-M-t → open tilix
- Click on the preference icon:
- Global → Automatically copy text to clipboard when selecting
- Appearance → window style → disable CSD / hide toolbar
- Appearance → Theme variant → Dark
- Appearance → Default session name → Terminal
- Appearance → Terminal title style → None
- Appearance → Application title → \({hostname}:\){directory} [\({columns}x\){rows}]
- Shortcuts → page down → page down
- Shortcuts → page up → page up
- Default → General → Terminal size → 100 60
- Default → General → Custom font : Monospace 10
- Default → Command → Run command as a login shell
1.4. Windows
Applications → Window manager
- Style → Greybird-dark-accessibility
- Keyboard → maximize window Alt-Fn-F10
- Keyboard → move window Alt-Fn-F7
- Keyboard → resize window Alt-Fn-F8
- Keyboard → show desktop → Alt-F9
- Keyboard → Move window to left workspace → Shift-Ctrl-Alt-Left
- Keyboard → Move window to right workspace → Shift-Ctrl-Alt-Right
1.5. Drivers Nvidia
sudo apt install nvidia-driver-455
- Reboot
1.6. Background Image
Applications → Desktop → select an image
1.7. GPG Keys
sudo apt install gnupg2
1.8. OwnCloud
sudo apt install gnome-keyring
sudo apt install python3-keyring
Follow the instructions on: https://download.owncloud.com/desktop/ownCloud/stable/latest/linux/download/ and make sure that the owncloud files in
/etc/apt/sources.list.d/
and in/etc/apt/trusted.gpg.d/
have-r--r--r--
permissions:sudo chmod go+r /etc/apt/sources.list.d/owncloud.list sudo chmod go+r /etc/apt/trusted.list.d/owncloud.gpg
- Launch
/opt/ownCloud/ownCloud/bin/owncloud
- Connection server:
https://mycore.core-cloud.net
- User: xxxxxxxx.xxxxxxxx@cea.fr
- Password: specific.
1.9. Eduroam
- Launch
~/ownCloud/Ordinateurs/Eduroam/eduroam-linux-eduroam.py
- Configure the WIFI:
- Sécurité:
- WPA et WPA2 d'entreprise
- Authentification:
- TLS avec tunnel (TTLS)
- Identitié masquée:
anonymous@eduroam.cnrs.fr
- Certificat CA:
~/.cat_installer/ca.pem
- Authetification interne:
- PAP
- Nom d'utilisateur:
- ae78hm@eduroam.cnrs.fr
- Mot de passe:
- secret sentence (see in
~/ownCloud/Ordinateurs/Eduroam/eduroam.org
)
1.10. Forticlient
sudo apt remove forticlientsslvpn-cea
sudo dpkg -i ~/ownCloud/AIM_Dap/forticlientsslvpn-cea_4.4.2342_amd64.deb
- Accept the license
- Close the graphical interface without filling the form
- Launch the VPN with the command
fortisslvpn_cli --server mobietendu-ea.cea.fr:443 --vpnuser xxxxxxxx@extra.cea.fr
(alias vpncea) - Password is the extra password
- C-c to quit
1.11. Disks
1.11.1. Partition of the primary disk
sudo fdisk -l
sudo lvresize -r -L 80G /dev/mapper/crypt-root
sudo lvresize -r -L 10G /dev/mapper/crypt-var
sudo lversize -r -L 800G /dev/mapper/crypt-home
1.11.2. Formatting and mounting the secondary disk
sudo fdisk /dev/nvme1n1
- g
- w
sudo fdisk /dev/nvme1n1
- n
- default sectors
- w
1.11.3. Crypting partitions
- Create the crypted partition:
sudo cryptsetup --cipher aes-xts-plain --key-size 512 --hash sha512 -v luksFormat /dev/nvme1n1
- Type a password sentence
1.11.4. Putting everything together
- Open the crypted partition:
sudo cryptsetup -v luksOpen /dev/nvme1n1 Disk2
.- Type:
- password sentence
- Create a filesystem:
sudo mkfs -t ext4 -L LuksPartition /dev/mapper/Disk2
.- Mount the partition
sudo mount /dev/mapper/Disk2 /mnt/data
- Create a backup
sudo cryptsetup -v luksHeaderBackup /dev/nvme1n1 --header-backup-file LuksHeaderBackup_data.bin
1.11.5. Automatically mount a crypted partition
- Create a random key
- Create the directory
/etc/luks-keys
if it does not exist sudo chmod go-rwx /etc/luks-keys
sudo dd if=/dev/urandom of=/etc/luks-keys/Disk2_key bs=512 count=8
- Create the directory
- Add the random key
sudo cryptsetup -v luksAddKey /dev/nvme1n1 /etc/luks-keys/Disk2_key
- Change the rights of
Disk2_key
to have-r--------
- Test the key:
sudo cryptsetup -v luksOpen /dev/nvme1n1 Disk2 --key-file=/etc/luks-keys/Disk2_key
- Close the partition:
sudo cryptsetup -v luksClose Disk2
- Automatically open the volume
- Print the UIID volume:
sudo cryptsetup luksDump /dev/nvme1n1 | grep "UUID"
- Edit
/etc/crypttab
: - add the line
Disk2 UUID=d98a244a-1aac-4ab7-965d-936aa0c61eeb /etc/luks-keys/Disk2_key luks
- Check everything is OK:
sudo cryptdisks_start Disk2
.
- Automatically mount the disk
Add in
/etc/fstab
:/dev/mapper/Disk2 /mnt/data ext4 defaults 0 2
1.12. Swap
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=10
sudo chmod 0600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
grep Swap /proc/meminfo
- Add
/swapfile swap swap sw 00
at the end of/etc/fstab
1.13. Sleep issue on CEA laptops
sudo apt install pm-utils
- Use
pm-suspend
in place ofsystemctl suspend
1.14. Printing with CUPS
sudo vi ~/.cups/client.conf
(a priori, the file does not exist)- Write in the file:
servername sapprint.extra.cea.fr
1.15. Sync Google calendars
crontab -e
(withoutsudo
)- Add the line
0 0,12 * * * ~/ownCloud/Organisation/sync_gcal.sh
1.16. Date format
sudo vi /etc/default/locale
- Edit:
LANG="=fr_FR.UTF-8=" LANGUAGE="=fr_FR:en_US=" LC_ALL="=fr_FR.UTF-8="
- Reboot
- When restarting, the system asks if we want to keep the directory names (Desktop/, Pictures/, etc.) in English ⇒ answer yes
1.17. BIOS Update & Firmware
sudo service fwupd start
sudo fwupdmgr refresh
sudo fwupdmgr update
2. SOFTWARE
2.1. Web Browser
2.1.1. Firefox
- Installed by default
- Sync the keywords and bookmarks
2.1.2. Brave
sudo apt install apt-transport-https curl
sudo curl -sS https://brave-browser-apt-release.s3.brave.com/brave-core.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/brave-browser-release.gpg
echo "deb [signed-by=/etc/apt/trusted.gpg.d/brave-browser-release.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list
Make sure that the brave files in
/etc/apt/sources.list.d/
and in/etc/apt/trusted.gpg.d/
have-r--r--r--
permissions:sudo chmod go+r /etc/apt/sources.list.d/brave-browser-release.list sudo chmod go+r /etc/apt/trusted.list.d/brave-browser-release.gpg
sudo apt update
sudo apt install brave-browser
- Sync the keywords and bookmarks
- Make Brave the default browser:
xdg-settings set default-web-browser brave-browser.desktop
2.1.3. Chrome
sudo sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt update
sudo apt install google-chrome-stable
2.2. Emacs
sudo apt install emacs
works well, but some packages downloaded withmelpa
might be more recent and cause bugs. For the February 2024 installation I made,apt
was giving meemacs
27.1, while I needed version 28 to makeauctex
work. I thus installedemacs
from the repo:sudo apt remove --autoremove emacs emacs-common
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt emacs28
- Remove everything within
~/.emacs.d/
, exceptlisp
andinit.el
.
2.2.1. Packages installed with MELPA (in ~/.emacs.d/elpa/
)
Install with M-x list-packages
.
auctex
auctex-latexmk
auctex-lua
calfw
calfw-ical
calfw-org
elpy
fortpy
guide-key
helm-bibtex
htmlize
hydra
neotree
org
org-bullets
org-super-agenda
pdf-tools
rainbow-mode
symon
use-package
guess-language
gnus
(built-in)recentf
(built-in)saveplace
(not found anymore)paren
(not found anymore)printing
(built-in)org-msg
smtpmail
(not found anymore)dired-subtree
dired-rainbow
rainbow-delimiters
php-mode
tablist
(dependency)let-alist
(built-in)gnu-elpa-keyring-update
highlight-indent-guides
2.2.2. Packages installed by hand (in ~/.emacs.d/lisp/
)
template
org-msg
org-faces
grammalecte-cache
For each .el in the directory, do M-x byte-compile <file>
. If the file .el is not available, download it from GitHub.
2.2.3. Dictionnaries for spell-checking
sudo apt install ispell
.hunspell -D
→ lists the dictionnaries already installed and their location (/usr/share/hunspell/
).- Download dictionnaries from the LibreOffice extension repository.
Extract the
.aff
and.dic
files from the.oxt
archives:unzip lo-oo-ressources-linguistiques-fr-v5-7.oxt -d dict-fr sudo cp dict-fr/*/*.aff dict-fr/*/*.dic /usr/share/hunspell/ rm -r dict-fr
Since we use the default local variables
fr_FR
, our main French dictionnary should be renamed:sudo cp /usr/share/hunspell/fr-classique.aff /usr/share/hunspell/fr_FR.aff sudo cp /usr/share/hunspell/fr-classique.dic /usr/share/hunspell/fr_FR.dic
2.2.4. For emails
sudo apt instal isync
(for mbsync, the software retrieving the mails from the server)sudo apt install altermime
(with default settings in the dialog)sudo apt install html2text
- Mu (powerful email search tool)
- New mu install (works in 22.04)
sudo apt install xapian-tool
sudo apt install maildir-tools
sudo apt install mu4e
- Old mu install
- Prior to that, you need to install meson and other libraries (look at the Github page). However, do not do that using the
--user
option inpip3
. Do it assudo
, otherwise it won't work when you will dosudo make install
. sudo apt install libssl-dev
- Install cmake from the repo (not using apt; the version is not high enough)
sudo apt install guile-3.0
sudo apt install graphviz
sudo apt install doxygen
sudo apt install help2man
sudo apt install python3-docutils
sudo apt install libmagic-dev
sudo apt install bison
sudo apt install libcld2
- Download xapian-core from Github and install it.
- Download tarball from https://github.com/djcb/mu
- Follow the instruction to manually install
mu
- Prior to that, you need to install meson and other libraries (look at the Github page). However, do not do that using the
- Setting-up mu
mkdir ~/mail
mkdir ~/mail/CNRS
mu init --maildir=~/mail --my-address=xxxxxxxx.xxxxxxxx@cea.fr --my-address=xxxxxxxx.xxxxxxxx@cnrs.fr
mu index
It can be used on the command line to search emails, e.g.
mu find coucou
. To list the contacts:mu cfind
.
- New mu install (works in 22.04)
- Create a certificate
mkdir -p ~/.cert
openssl s_client -connect imap.cnrs.fr:993 -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sed -ne '1,/-END CERTIFICATE-/p' > ~/.cert/imap.cnrs.fr.pem
- Configuration of mbsync
- Create the
~/.mbsyncrc
file (always the same) - Create a crypted password file with gpg2:
Create
~/tmp
file with:machine imap.cnrs.fr login xxxxxxxx.xxxxxxxx@ods.services password XXX machine smtp.cnrs.fr login xxxxxxxx.xxxxxxxx@ods.services password XXX machine imap.extra.cea.fr login xxxxxxxx password XXX machine mx.extra.cea.fr login xxxxxxxx password XXX machine imap.sfr.fr login xxxxxxxx.xxxxxxxx@neuf.fr password XXX machine smtp.sfr.fr login xxxxxxxx.xxxxxxxx@neuf.fr password XXX
gpg2 --output .authinfo.gpg --symmetric tmp
rm ~/tmp
- It can be used on the command line, without going through emacs:
mbsync -aV
⇒ sync all mailboxes. This is what emacs spawns.
- Create the
- Trouble shooting
If the certificate changes, run:
openssl s_client -connect imap.cnrs.fr:993 -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sed -ne '1,/-END CERTIFICATE-/p' > ~/.cert/imap.cnrs.fr.pem
2.3. LaTeX et MusiXTeX
sudo apt install texlive-full
2.3.1. Extra fonts
sudo apt install texlive-latex-extra fonts-arabeyes fonts-kacst
sudo apt install fontforge
sudo apt install cabextract
wget https://gist.github.com/maxwelleite/10774746/raw/ttf-vista-fonts-installer.sh -q -O - | sudo bash
fc-list | grep Calibri
sudo apt install ttf-mscorefonts-installer
wget -qO- http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer | bash
2.4. Git
sudo apt install git-all
2.5. Fortran
sudo apt install gfortran
2.5.1. HDF5
- Required libraries
sudo apt-get install debhelper
sudo apt-get install sharutils
sudo apt-get install chrpath
sudo apt-get install php-cli
sudo apt-get install libaec-dev
- Install from source code
- Download the archive from: https://www.hdfgroup.org/downloads/hdf5/source-code/
cd ~/Downloads
gunzip < hdf5-X.Y.Z.tar.gz | tar xf -
cd hdf5-X.Y.Z
sudo ./configure --prefix=/usr/local/hdf5 --enable-fortran
sudo make
sudo make check
sudo make install
sudo make check-install
rm -r hdf5-XXX*
2.6. Python
2.6.1. Standard
sudo apt install ipython3
sudo apt install python3-pip
- Modules (without
sudo
):pip install numpy
pip install scipy
apt install tk-dev
(for matplotlib)pip install matplotlib
pip install astropy
pip install h5py
pip install drawSvg
pip install cairosvg
pip install csv
pip install PyPDF2
pip install datetime
pip install pandas
pip install reproject
pip install photutils
pip install scikit-learn
2.6.2. Anaconda
- Download
anaconda
from https://www.anaconda.com/products/individual sha256 Anaconda-2021.11-Linux-x86_64.sh
bash Anaconda-2021.11-Linux-x86_64.sh
- Don't care about the PYTHONPATH warning
- Once the installation is finished, a paragraph has been added in
~/.bashrc
:- Add
conda config --set auto_activate_base false
after it - If it is not there, add the call to
bashrc.sh
(aliases) after that.
- Add
- To install a package:
conda install matplootlib
- To turn off the annoying prompt:
conda deactivate
2.6.3. Nerd-dictation
pip3 install vosk
sudo apt install xdotool
git clone https://github.com/ideasman42/nerd-dictation.git
cd nerd-dictation
wget https://alphacephei.com/kaldi/models/vosk-model-small-en-us-0.15.zip
unzip vosk-model-small-en-us-0.15.zip
mv vosk-model-small-en-us-0.15 model
mv ~/nerd-dictation ~/bin/
mkdir -p ~/.config/nerd-dictation
mv ./model ~/.config/nerd-dictation
- Then also download larger models from https://alphacephei.com/vosk/models
2.6.4. Extra fonts
sudo apt install font-manager
sudo apt install fonts-comic-neue
sudo apt install fonts-humor-sans
sudo apt install ttf-mscorefonts-installer
- Download the xkcd fonts (https://github.com/ipython/xkcd-font/tree/master)
Install them:
sudo mkdir /usr/share/fonts/truetype/xkcd sudo cp ~/Downloads/xkcd.otf /usr/share/fonts/truetype/xkcd/ sudo cp ~/Downloads/xkcd-script.ttf /usr/share/fonts/truetype/xkcd/ sudo cp ~/Downloads/xkcd-Regular.otf /usr/share/fonts/truetype/xkcd/ sudo fc-cache -f -v
- Eventually clean the matplotlib cache:
rm -r ~/.cache/matplotlib
2.7. IDL
cd $idlib
;tar -xzvf idl70pluslicense.tar.gz
sudo mkdir /usr/local/itt
sudo chmod a+rx /usr/local/itt
cd /usr/local/itt
sudo tar -xzvf $idlib/idl70linux.x86.tar.gz
sudo ./install
(no DICOM)- Copy the directory
license
in/usr/local/itt/license
:sudo cp -r $idlib/license/ /usr/local/itt/
- Install the following 32 bit librarires:
sudo apt install libxmu6:i386
sudo apt install libxpm4:i386
sudo apt install libgtk2.0-0:i386
wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.2_amd64.deb
(not available anymore, insteadsudo apt install binutils-multiarch
)sudo dpkg -i multiarch-support_2.27-3ubuntu1.2_amd64.deb
sudo dpkg -i $idlib/libxp6_1.0.2-1ubuntu1_amd64.deb
sudo apt install libxft2:i386
sudo apt install libstdc++5:i386
sudo apt install libc6-i386
sudo apt install libxtst6:i386
sudo apt install lib32z1
- To install
libxp6
, you need to installmultiarch-support
:wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1_amd64.deb
sudo apt install ./multiarch-support_2.27-3ubuntu1_amd64.deb
- To use the 64 bit version, install
libxp6
(Debian package included in the directory$idlib
):sudo dpkg -i libxp6_1.0.2-1ubuntu1_amd64.deb
- Add in the
.bashrc
:- only if
LD_LIBRARY_PATH
is empty:LD_LIBRARY_PATH=/usr/local/lib
- then:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/itt/idl/bin/bin.linux.x86_64
- and:
export LD_LIBRARY_PATH
- only if
- Open IDL launching
/usr/local/itt/idl/bin.linux.x86_64/idl
2.8. PDF
2.8.1. Readers
sudo apt install okular
sudo apt install qpdfview
sudo apt install qpdf
sudo apt install pdfsam
2.8.2. Have hyperlinks open with Brave
sudo kcmshell5 filetypes
- Select text > html
- Put Brave on top of the list
2.8.3. PDF Presenter Console
sudo apt install pdfpc
2.8.4. Converting HTML to PDF
sudo apt install wkhtmltopdf
2.8.5. Universal converter
sudo apt install pandoc
2.8.6. PDFArranger
To rearrange the pages of a PDF:
sudo add-apt-repository ppa:linuxuprising/apps
sudo apt update
sudo apt install pdfarranger
2.9. Zoom
- Download the package from https://zoom.us/download?os=linux
sudo dpkg -i zoom_amd64.deb
- Launch Zoom
- Identification: SSO
- Domaine: u-paris.zoom.us
- We are then redirected toward the authentification page from the University
2.10. Dropbox
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
~/.dropbox-dist/dropboxd
2.11. Images
2.11.1. ImageMagick
It is installed by default (instruction convert
on the command line). However, it does not work on PS and PDF, by default. To fix this issue, edit /etc/ImageMagick-6/policy.xml
and replace the rights none
by read|write
for PS, PDF, and EPS.
2.11.2. PNG compression
sudo apt install pngquant
2.11.3. Webp conversion
sudo apt install webp
2.11.4. FITS files
sudo apt install saods9
2.11.5. Diaporama
sudo apt install gwenview
2.11.6. Drawing
sudo apt install inkscape
2.11.7. Webcam
sudo apt update cheese
2.12. Music
sudo apt install audacity
sudo apt install gtick
sudo apt install musescore3
sudo apt install lilypond
sudo apt install evince
sudo apt install timidity
sudo apt install hydrogen
sudo apt install jack
sudo apt install timidity timidity-interfaces-extra
2.13. 3D
sudo apt install openscad
2.14. Miscellaneous
sudo apt install gcal
sudo apt install xfce4-screenshooter
sudo apt install xfce4-battery-plugin
sudo apt install vlc
sudo apt install ffmpeg
sudo apt install arp-scan
sudo apt install nmap
sudo apt install freerdp2-x11
3. SETTING FILES TO IMPORT
3.1. Bashrc
Once the ~/ownCloud/
directory is synchronised, add in ~/.bashrc
:
export bashalias=$HOME/ownCloud/Settings/bashrc.sh if [ -f $bashalias ]; then . $bashalias fi
3.2. Emacs
- Import
~/.emacs.d/
(mainlyinit.el
andlisp/
) - Import
~/.saves/
- Import
~/.templates/
3.3. Rest
- Import
.bashrc
- Import
.mbsyncrc
- Import
.vimrc
3.4. Release Upgrade at CEA
sudo apt update
sudo systemctl stop puppet
sudo systemctl disable puppet
sudo rm -r /etc/apt/sources.list.d/
sudo do-release upgrade
- Accept the default variables at each prompt.
- Once it is done reboot and ask the computer people to check everything
sudo systemctl start puppet
sudo systemctl enable puppet
4. TROUBLE SHOOTING
4.1. Snap
In general avoid snap
. It is always better to install the deb from the repository if there is a problem with apt
.