0. Debian Backports
Backports are recompiled packages from testing (mostly) and unstable (in a few cases only, e.g. security updates) in a stable environment so that they will run without new libraries (whenever it is possible) on a Debian stable distribution
Backports cannot be tested as extensively as Debian stable, and backports are provided on an as-is basis, with risk of incompatibilities with other components in Debian stable. Use with care!
It is therefore recommended to select single backported packages that fit your needs, and not use all available backports.
Add backports to your sources.list
- For stretch (at the present moment) add this line:
1 | deb http://ftp.debian.org/debian stretch-backports main |
- Run apt update.
Install a package from backports
All backports are deactivated by default (i.e. the packages are pinned to 100 by using ButAutomaticUpgrades: yes in the Release files. If you want to install something from backports run (you can use aptitude too):
1 | sudo apt -t stretch-backports install "package" |
1. Add [multimedia][deb-multimedia] repos
After you have added the necessary line in /etc/apt/sources.list (as below)
1 | deb ftp://ftp.deb-multimedia.org stable main non-free |
the first package to install is deb-multimedia-keyring.
1 | sudo apt update && apt install -y deb-multimedia-keyring |
2. Update the operating system
1 | sudo apt update && time sudo apt dist-upgrade |
3. Install sudo and set permissions
As root execute below commands.
1 | # apt install -y sudo |
4. Installer for Microsoft TrueType core fonts
1 | sudo apt install ttf-mscorefonts-installer |
More ways to install fonts
Sometimes you download .ttf file (a font file) and you want to install it directly. In that case, copy the font file to one of the following directory.
The fonts can be copied in one of this directories:
/usr/share/fonts
/usr/share/X11/fonts
/usr/local/share/fonts
~/.fonts
Here’s how the directories work.
If you want the fonts for everyone on the system (i.e. in a multiuser environment) then put them on /usr/share/fonts.
If you only want the fonts for yourself, then put them on ~/.fonts/ directory of your home folder.
Once you’ve copied the files in correct places, issue the following command to which will read and cache all installed fonts from these directories.
1 | # fc-cache -fv |
Now if you want to list all installed and cached fonts on your system, you need to use fc-list command.
Sample output below:
1 | # fc-list |
Configuring Fonts on Linux
1 | # dpkg-reconfigure fontconfig-config |
5. Install the “good stuff” such as unrar, smplayer, etc
Keep in mind I am using debian based distro and KDE, for instance some packages names don’t be able to fix with your current distro.
1 | sudo apt install unrar rar curl vim mesa-utils htop lm-sensors screen kde-config-touchpad sysv-rc-conf transmission subtitleeditor pavucontrol gthumb tree |
Browsers
- chromium - the web browser from Google
1 | sudo apt install chromium chromium-l10n |
- Brave
Installing brave Debian 9+, Ubuntu 14.04+ and Mint 17+
If you get gnutls_handshake() errors after adding the Brave repository on Debian 9, you may need to uninstall old conflicting packages.
1 | sudo apt install apt-transport-https curl |
6. Installing Git on GNU/Linux
If you want to install the basic Git tools on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution.
If you’re on a Debian-based distribution like Ubuntu, try apt:
1 | sudo apt install -y git git-flow |
And then run to setup the default email, name and editor:
1 | git config --global user.email "you@example.com" |
PS + Git (Current branch)
Add below code into your ~/.bash before the line unset color_prompt force_color_prompt to see your current git branch into the bash prompt. Idea taken from here.
1 | # Add git branch if its present to PS1. |
v2 27 March 2023
1 | # Drop this into your .zshrc or .bashrc file: |
References are gotten from Add a Git Branch to Your Prompt with a Few Lines of Shell Scripting and ChatGPT
Productive aliases
Common aliases
FILE: ~/.gitconfig
1 | [user] |
Command aliases (optional)
FILES: either ~/.profile or ~/.bashrc
1 | alias git_diff_commit='git whatchanged -m -n 1 -p $1' |
The go abbreviation for git checkout is very useful, allowing me to type:
1 | go <branch> |
to checkout a particular branch. Also, I often mistype git as get or got so I created aliases for them too.
Source
7. Install [screen][screen]
1 | apt install -y screen |
8. Install [Node.js][nodejs]
From this repository contains documentation for using the NodeSource Node.js Binary Distributions via .rpm, .deb and Snap packages as well as their setup and support scripts.
For Node.js 8:
1 | curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - |
Alternatively, for Node.js 9: Node.js 9.x is no longer actively supported!
1 | curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - |
Node.js v10.x:
1 | # Using Ubuntu |
1 | # Using Debian, as root |
Node.js v12.x:
1 | # Using Ubuntu |
1 | # Using Debian, as root |
Node.js v13.x:
1 | # Using Ubuntu |
1 | # Using Debian, as root |
8.1 Node Version Manager
POSIX-compliant bash script to manage multiple active node.js versions
Install & Update Script
To install or update nvm, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following cURL or Wget command:
1 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash |
1 | wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash |
Running either of the above commands downloads a script and runs it. The script clones the nvm repository to ~/.nvm, and attempts to add the source lines from the snippet below to the correct profile file (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).
1 | export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" |
8.2 Node Task List
Interactive cli to list and run package.json scripts.
Install in debian (or based on):
1 | sudo npm install -g ntl |
9. Editors
Install vim
1 | sudo apt install -y vim |
And then edit the file /etc/vim/vimrc to enable syntax highlighting.
Installing Atom on GNU/Linux
Currently only a 64-bit version is available.
- Download atom-amd64.deb from the Atom releases page.
Run sudo dpkg --install atom-amd64.deb on the downloaded package.
- Launch Atom using the installed atom command.
The Linux version does not currently automatically update so you will need to repeat these steps to upgrade to future releases.
You can read more informatoin in the Atom website.
Install Visual Studio Code
I use the repo to keep it update along the debian updates. The repository and key can also be installed manually with the following script:
1 | curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg |
Then update the package cache and install the package using:
1 | sudo apt update && sudo apt install -y code |
Install Sublime 3
Browser until the following URL https://www.sublimetext.com/3 and select your OS and arch or linux repos to download Sublime 3.
I have chosen the linux repos to install it. Install the GPG key:
1 | wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - |
Ensure apt is set up to work with https sources:
1 | sudo apt install apt-transport-https |
Select the channel to use (stable):
1 | sudo echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list |
Update apt sources and install Sublime Text
1 | sudo apt update |
PlainTasks Plugin
An opinionated todo-list plugin for Sublime Text editor (version 2 and 3)
Installation
To install this plugin, you have two options:
- If you have Package Control installed, simply search for PlainTasks to install.
- Clone source code to Sublime Text packages folder.
Sources
12. SQL
Clients Installation
PostgreSQL
1 | sudo apt install -y postgresql-client |
Some configuration for the PostgreSQL interactive terminal - psql.12. SQL
Edit the ~/.psqlrc file as below:
1 | \set AUTOCOMMIT off |
dbeaver Free universal database tool and SQL client. It can be downloaded and installed from this link.
Aministration
PostgreSQL pgAdmin III is a handy GUI for PostgreSQL, it is essential to beginners. To install it, type at the command line:
1 | sudo apt install -y pgadmin3 |
13. Install compressing packages
1 | sudo apt install -y p7zip p7zip-full unrar-free unzip |
14. Multimedia
- smplayer - Complete front-end for MPlayer and mpv.
- vlc - Multimedia player and streamer.
- soundconverter - GNOME application to convert audio files into other formats.
1 | sudo apt install -y smplayer mplayer vlc soundconverter audacious |
15. Install shutter
Feature-rich screenshot program
1 | sudo apt install -y shutter |
16. Monitoring and networking
- aptitude - Terminal-based package manager.
- intel-microcode - Processor microcode firmware for Intel CPUs.
- lm-sensors - Utilities to read temperature/voltage/fan sensors.
- neofetch - Shows Linux System Information with Distribution Logo.
- qapt-deb-installer - tool for installing deb files.
- net-tools - NET-3 networking toolkit.
- inxi - Full featured system information script
- baoba - Check folder sizes and vailable disk space.
1 | sudo apt install -y faketime htop duf ufw lshw inxi pdftk wget curl net-tools filezilla neofetch qapt-deb-installer aptitude intel-microcode lm-sensors baoba |
Use examples:
1 | sudo netstat -lnpt | grep Plex |
17. Audit the system
[Lynis][Lynis]: an open source tool that performs a local security assessment and audits local services for vulnerabilities. It is light-weight and easy to use; just unzip it and run the command
Import key
1 | wget -O - http://packages.cisofy.com/keys/cisofy-software-public.key | apt-key add - |
Add software repository
Using your software in English? Then configure APT to skip downloading translations. This saves bandwidth and prevents additional load on the repository servers.
1 | echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99disable-translations |
Adding the repository:
1 | echo "deb https://packages.cisofy.com/community/lynis/deb/ stretch main" > /etc/apt/sources.list.d/cisofy-lynis.list |
Install Lynis
1 | apt update && apt install -y lynis |
Run the report
1 | lynis audit system |
18. Download and install Heroku CLI
This version does not autoupdate. You’ll have to manually update the cli with apt. Use the standalone install for an autoupdating version of the CLI. Run the following to add our apt repository and install the CLI:
1 | wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh |
The script is easily typed in manually if you prefer not to pipe commands to sh.
Reference
https://devcenter.heroku.com/articles/heroku-cli#debian-ubuntu
19. Unlimited Bash History
Something very util is go back and see how I built/configured something, or what that nifty command was, or how some command broke something weeks ago.
To archive mencioned before, Set HISTSIZE and HISTFILESIZE in .bashrc to an empty value. Also it makes sense not enter lines which begin with a space or tab or duplicated (such as cd ..).
1 | HISTSIZE= |
HISTSIZE
The number of commands to remember in the command history (see HISTORY below). If the value is 0, commands are not saved in the history list. Numeric values less than zero result in every command being saved on the history list (there is no limit). The shell sets the default value to 500 after reading any startup files.
HISTFILESIZE
The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, if necessary, to contain no more than that number of lines by removing the oldest entries. The history file is also truncated to this size after writing it when a shell exits. If the value is 0, the history file is truncated to zero size. Non-numeric values and numeric values less than zero inhibit truncation. The shell sets the default value to the value of HISTSIZE after reading any startup files.
HISTCONTROL
A value of `ignorespace' means to not enter lines which begin with a space or tab into the history list. A value of `ignoredups' means to not enter lines which match the last entered line. A value of `ignoreboth' combines the two options. Unset, or set to any other value than those above, means to save all lines on the history list. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTCONTROL.
References
- Bash Variables: http://www.faqs.org/docs/bashman/bashref_60.html
- man bash
20. Terminals
- Yakuake - a Quake-style terminal emulator based on KDE Konsole technology..
- Terminator - Multiple GNOME terminals in one window
1 | sudo apt install yakuake terminator |
Terminator
Configuration file: ~/.config/terminator/config
Default config to open two different terminals horizonatally and executing a script:
1 | [global_config] |
21. Communication
Slack
Slack brings the team together, wherever you are.
Slack for linux
You can download deb and rpm binaries from here, and then just install it.
Install xclip
xclip is a command line utility that is designed to run on any system with an X11 implementation. It provides an interface to X selections (“the clipboard”) from the command line. It can read data from standard in or a file and place it in an X selection for pasting into other X applications. xclip can also print an X selection to standard out, which can then be redirected to a file or another program.
1 | sudo apt install xclip |
22. Code storage
Below you can find cloud storage service providers with native Linux client.
Dropbox
To install dropbox follow the next link.
Mega
23. Virutalization
Virtualbox
Download and install VirtualBox for Debian-based GNU/Linux hosts:
Add the following line to your /etc/apt/sources.list. According to your distribution, replace ‘
1 | sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list' |
The Oracle public key for apt-secure can be downloaded:
1 | wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - |
To install VirtualBox, do:
1 | sudo apt update |
Finally if you need anything of the following: Support for USB 2.0 and USB 3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards, then install the Entension Pack.
23. Miscellaneous
- fortunes - Data files containing fortune cookies. Configuration here.
1 | sudo apt install fortunes fortunes-es |
- KPatience - KPatience is a compendium of several well known patience card games, ranging from the well known Klondike and Freecell, to lesser known games such as Grandfather’s Clock and Mod3. In all there are 12 variations for you to while away time.
1 | sudo apt install kpat |
Update 25 March 2023
As returnning Debian 12 with the testing version, after almost two years using Fedora and being impossible to install OpenSuse. I update my new founds, new interesting stuff and forgotten things.
1 | OS: Debian GNU/Linux 12 (bookworm) x86_64 |
Uninstall no needed stuff.
For example the Debian desktop environment
1 | sudo taskselect |
and then deselect: Debian desktop environment (although the installation you can select it, it’s selected :)), uninstalling a whole bunch of stuff that is seemigly important to make the system widelight and lean.
Install nala pacakage manager
An enhanced user-friendly tool for managing apt packages. Features of Nala:
- Parallel downloads.
- Checks for the fastest mirrors and uses the fastest 3 by default to speed up downloads.
- Each command you execute will be stored as Nala history with a unique ID.
- Compatible with Fish and Zsh.
- Makes Apt more human-readable than ever.
1 | sudo apt install -y nala |
Check Fasters Mirrors
Nala
To fetch the fastest mirrors, you’d need to utilize the fetch utility. First, it will determine whether you are using Debian or Ubuntu and then list the fastest mirrors:
1 | sudo nala fetch |
install netselect-apt
Permit us to automatically select the fastest mirrors that are closest to us.
1 | sudo nala install netselect-apt |
Go to the mirror list and select the fastest mirror.
1 | # -c: countery |
Zram compressed swap
To setup fast swap ram for SSD disk not having a swap partition.
1 | sudo nala install systemd-zram-genererator |
Then let the system new about the new swap service.
1 | sudo systemdctl daemon-reload |
and the start the systemctl service:
1 | sudo systemdctl start /dev/zram0 |
finally check there now is swap (it’s not a partition, it’s region on RAM that’s compressed and it’s very fast and secure as it wiped in eahc reboot).
1 | free -g |
Virtualization
The virt-manager application is a desktop user interface for managing virtual machines through libvirt. It primarily targets KVM VMs, but also manages Xen and LXC (linux containers).
1 | sudo nala install virt-manager |
Flatpak
Enable flatpaks for further testing for the Discover utility in the app manager.
1 | sudo nala install plasma-discover-backend-flatpak |
It’s very handy for installing flatpaks, then for the Discover app enable flatpaks:
Settings -> Add Flathub (on the top right corner)
Stand by until the Flatpak arises in the top left corner.
Logout and login and try it from the Discover app and search and isntall: system monitoring center.
then check already installed flatpaks:
1 | flatpak list |
Distrobox
For cotainer management and podman, as you can run podman as rootless container and can play aroutn with your container sandboses without affecting the rest of the system.
1 | sudo nala install distrobox |
Test it
1 | distrobox-create --name ubuntults --image ubuntu:22.04 |
Pretty cool eh!