Package and Process Management

                    Package and Process Management

Package Management:
          Package management is a system by which software can be installed, updated, queried or removed from a file system. In Linux, there are many different software package management systems, but the two most popular are those from Debian and Red Hat.

Debian :
            The Debian distribution and its derivatives such as Ubuntu and Mint, use the Debian package management system. At the heart of Debian-derived distributions package management are the software packages that are distributed as files ending in ".deb".
Commands:
            dpkg – it is lowest level tool for managing.
            dpkg apt-get - it is front end management tool for cilents.
            dpkg aptitude –it is back-end management tool for server.

The Debian repositories contain more than 65,000 different packages of software

Commands

Commands
Syntax
Description
Update packages
$ sudo apt-get update
It will update all packages through online.
Search Package
$ sudo apt-cache search <Keyword>
It will help to search package
Install package
$ sudo apt-get install <package>
It will help to install package.
Upgrade package
$ sudo apt-get upgrade
It will used to upgrade all possible packages.
Removing package
$ sudo apt-get remove <Package>
It will use to remove package without configuration file.

$ sudo apt-get –purge remove <Package>
It will use to remove package with all files.

$ dpkg -l
It will display all installed package.


Red-Hat:
          Red-hat Package Management (RPM).
RPM makes use of an .rpm file for each software package. This system is what Red Hat-derived distributions (like Red Hat, Centos, and Fedora) use to manage software. In addition, several other distributions that are not Red Hat-derived (such as SUSE, OpenSUSE and Mandriva) also use RPM.
The back-end tool most commonly used for RPM Package Management is the rpm command. While the rpm command can install, update, query and remove packages, the command line front end tools such as yum and up2dateautomate the process of resolving dependency issues.

Commands:

Commands
Syntax
Description
Install Package
# yum install package
It used to install package
Search package
# yum search <Keyword>
It is used to find packages
Update Package
# yum update <Package>
It is used to update mentioned package

# yum update
Used to update all packages
Removing Package
# yum remove <package>
It used to remove package

# rpm -qa
To view installed packages

Process Management:

            The implementation of the Linux kernel includes many subsystems that are a part of the kernel itself and others that may be loaded in a modular fashion when needed. Some of the key functions of the Linux kernel include a system call interface, process management, memory management, virtual filesystem, networking, and device drivers.
In a nutshell, the kernel accepts commands from the user and manages the processes that carry out those commands by giving them access to devices like memory, disks, network interfaces, keyboards, mice, monitors and more.
The kernel provides access to information about running processes through a pseudo filesystem that is visible under the /proc directory. Hardware devices are made available through special files under the /dev directory, while information about those devices can be found in another pseudo filesystem under the /sys directory.
The/proc directory not only contains information about running processes, as its name would suggest (process), but it also contains information about the system hardware and the current kernel configuration.
The output from executing ls /proc shows more than one hundred numbered directories. There is a numbered directory for each running process on the system, where the name of the directory matches the PID (process ID) for the running process.
Because the /sbin/init process is always the first process, it has a PID of 1and the information about the /sbin/init process can be found in the /proc/1 directory. As you will see later in this chapter, there are several commands that allow you to view information about running processes, so it is rarely necessary for users to have to view the files for each running process directly.
You might also see that there are a number of regular files the /proc directory, such as /proc/cmdline, /proc/meminfo and /proc/modules. These files provide information about the running kernel:
  • The /proc/cmdline file can be important because it contains all of the information that was passed to the kernel was first started.
  • The /proc/meminfo file contains information about the use of memory by the kernel.
  • The /proc/modules file holds a list of modules currently loaded into the kernel to add extra functionality.
Again, there is rarely a need to view these files directly, as other commands offer more "user friendly" output and an alternative way to view this information.
While most of the "files" underneath the /proc directory cannot be modified, even by the root user, the "files" underneath the /proc/sys directory can be changed by the root user. Modifying these files will change the behavior of the Linux kernel.
Direct modification of these files cause only temporary changes to the kernel. To make changes permanent, entries can be added to the /etc/sysctl.conffile.

Process hierarchy:
When the kernel finishes loading during the boot procedure, it starts the /sbin/init process and assigns it a Process Id (PID) of 1. This process then starts other system processes and each process is assigned a PID in sequential order.
As the /sbin/init process starts up other processes, they in turn may start up processes, which may start up other processes, on and on. When one process starts another process, the process that performs the starting is called the parent process and the process that is started is called the child process. When viewing processes, the parent PID will be labeled PPID.
When the system has been running for a long time, it will eventually reach the maximum PID value, which can be viewed and configured through the /proc/sys/kernel/pid_max file. Once the largest PID has been used, the system will "roll over" and resume by assigning PID values that are available at the bottom of the range.
Commands:
Commands
Syntax
Description
Process
$ ps
Only show the current process in shell.
Process tree
$ ps --forest
It will display the hierarchy process of parent process

$ ps –e | grep <package name>
It will display corresponding package’s process.

$ ps –U <user name>
It will display the process for particular user

$ top
It is regularly updating process with currently running packages

$ free
It will display how much size of memory is in free

$ free –s 10
Every 10 second it will update about free size.




          

Comments

Popular Posts