Linux Debian
Excellent References
Book - [REF-3]
Basic Concept
Application running in user space can access kernel resources by directly invoking Linux system calls or by invoking libc (or glibc)-provided API calls. In the latter case, libc (or glibc) invokes a Linux system call.
Drivers in user space can directly access hardware, can access a Linux system call, or can access libc (or glibc) APIs. libc (or glibc) is an example library running in user space; there are many more such user space libraries.
bashis a Unix shell, a user command line interface (CLI). It is the default shell on Debian OS.
Package Management
apt is debian package management.
Debian maintains a list of links to repository that apt- or apt-get can download from. The list(s) is stored in a file /etc/apt/sources.list, and in a directory containing the list files. These files are merged at runtime to form the complete list. Therefore, the content format of these files are exactly the same.
The benefits for allowing list of files in the sources.list.d folder are: ease of configuration and automation. For example, to disable a repository that is listed on a file, you can just remove the file instead of manipulating the main list (i.e. sources.list).
Also see:
[REF-4] How does apt-get really work?
/etc
/etc is where a Linux system's configuration files live.
apt Repository list -
File System Table -
/etc/fstab;Note: Add entry in thefstabfile to persist mount point across reboot.Hosts -
/etc/hostsrc.local -
/etc/rc.local; for setting start-up program;Timezone -
/etc/timezone;
Networking
The networking folder -
/proc/net/
For example, the host IP can be found in the file
fib_trie
How-to
Basic info
Admin
Setup Environment
Add the executable path to your PATH variable
Typically, the application is installed at the executable path ~/.local/bin. To add this path to your PATH variable:
The shell profile script in stored in the user folder,
~Bash –
.bash_profile,.profile, or.bash_login.Zsh –
.zshrcTcsh –
.tcshrc,.cshrcor.login.
Add an export command to your profile script. The following example adds the path represented by
~/.local/binto the current PATH variable.
Load the profile script described in the first step into your current session. The following example loads the profile script represented by
PROFILE_SCRIPT
Echo the PATH
Setting Environment vars
The Global environment variables of your system are stored in /etc/environment. Any changes here will get reflected throughout the system and will affect all users of the system. Also, you need to reboot or source, for any changes to take effect. Eg. source /etc/environment
User level Environment variables are mostly stored in .bashrc and .profile files in the user home directory. Changes only affect that particular user. Close and reopen the terminal for configuration changes to take effect. E.g., source .bashrc
Configure
Program to run at boot
Old school mechanism for starting python program, svc.py at boot:
add it to
/etc/rc.localmake sure
rc.localruns at boot timemust be setup as root.
setup commands:
Alternative: see "A super-simple way to run scripts on boot - crontab"
Package Management
List of apt repositories
For raspbian, see an example of the default content of /etc/apt/sources.list
For debian, see /etc/apt/sources.list.d/debian.list
Also see:
man sources.listfor details[REF-5] How to Add Apt Repository in Ubuntu & Debian
Install & Uninstall package
Notes:
Do not consider recommended packages as a dependency for installing
during package search, gathers the list required packages, recommended packages, and suggested packages
The required packages are dependencies so their installation is mandatory
The recommended packages will be installed by default unless the
--no-install-recommendsis specified or turned off in the/etc/apt/apt.confThe suggested packages is not installed by default
Also see https://www.howtoforge.com/linux-dpkg-command/ for additional
dpkgfeatures & how-to
Services
TODO:
journalctl;
Build-tool
Source: https://www.youtube.com/watch?v=9vsu67uMcko
Buildroot
OpenWrt
Yocto
Books
Google Drive > Books > Linux - https://drive.google.com/drive/folders/0B-bIAh9FWNPdcFNQSWtKM2ZhYzg?resourcekey=0-FlrlIakV5ZuQGdbI92OUPw&usp=sharing
LEARN - Linux - Ubuntu > SYNCH > Google Drive
References
[REF-1] The Linux Documentation Project; compilation of books, references, etc.; all free; MUST visit;
[REF-2] LinuxCommand.org
[REF-3] The Linux Command Line book download here
[REF-4] How does apt-get really work?
Last updated