Posts Tagged ‘remove’

The kernel is the heart of the Operating System. Linux Kernel could be Monolithic or Modular. A monolithic kernel supports everything (hardware, network, file systems) compiled from a single file; mostly used in embedded systems. A Modular kernel comprises of some drivers compiled as object files, which can be loaded or removed anytime. Modular kernel doesn’t need to be always recompiled when a hardware is added.

To check you current kernel version, enter the command:
uname -a
uname -r

More on Modular Kernel…
The modular kernel consists of the kernel itself and athe kernel modules.
All modules of a kernel are stored in /lib/modules/$(uname -r) and have a file extension of ko.

Controlling Kernel modules: utilities supplied by nmdutils package

lsmod – lists currently loaded kernel modules
syntax:

lsmod

rmmod – low level command used to remove a module
syntax:

rmmod modulename

insmod – low level command used to insert a module
syntax:

insmod filename

modinfo – display module details

depmode – determines module dependencies and rebuilds /lib/modules/kernel-version/modules.dep

modprobe – loads and removes modules, takes care of dependencies. configuration files is stored in /etc/module.conf & /etc/conf.modules.
syntax:

sudo modprobe modulename
sudo modprobe -r modulename

e.g.

sudo modprobe vfat
lsmod  | grep fat output:
vfat	17335	0
fat	55505	1 vfat

sudo modprobe -r vfat
lsmod | grep fat output:
--output blank--

Package management automate the process of installing, upgrading, configuring, and removing software packages.
dpkg is the basic tool for package management. dpkg does not handle dependencies. Here’s a list of of tasks using dpkg.

Package Management Task using dpkg

Install a package: dpgk -i package-file
Remove a package: dpkg -r package-name
Purge a package: dpkg -P package-name
Find out which files a package owns: dpkg -L package-name
Find out which package a file belongs to: dpkg -S filename
Extract information from package: dpkg -e package-file
List contents of package-file: dpkg -c package-file

configuration file for dpkg (dpkg.cfg) is stored in /etc/dpkg directory.
/var/lib/dpkg/ directory contains package management status and system files. The most important are:
alternatives – contains files that define and store configuration for the command alternatives on the system.
available – information about packages available to the system, retrieved from every specified sources.
status – information about packages installed on, or removed from the system.

You may also use apt tool, the ultimate package tool to manage packages. apt handles dependecies and it is one of the strengths of dpkg. apt provides users an easy way of installing and upgrading a system. Here’s a list of tasks using apt.

Package Management Task using apt

Choose which mirror to download from: apt-setup
Allows CD-ROM to be scanned for packages: apt-cdrom
Search all package description: apt-cache search package-name
Search a package full description: apt-cache show package-name
Install a package: apt-get install package-name
update list of packages: apt-get update
Upgrade any packages: apt-get upgrade
Upgrade entire distribution: apt-get dist-upgrade
Remove package: apt-get remove package-name

Configuration file for apt is stored in /etc/apt directory. apt.conf contains general options for APT, such as which release of Debian to install, which proxy settings to use, etc.
apt.conf.d is managed by the software that integrates with apt such as dpkg-reconfigure and apt-list changes.
apt-config is useful for troubleshooting apt.conf problems.