Thursday, February 16, 2012

How to Kill/Close The Process in Linux.

pkill vlc

or


killall -9 programName
killall -9 firefox
killall -9 lighttpd
killall -9 php-cgi
 First of all identify the "process id" (pid) of the process to kill.
[root@server ~#]ps -e                (display all the process in the system)
  PID TTY       TIME       CMD
    1   ?        00:00:00 init
    2   ?        00:00:00 kthreadd
    3   ?        00:00:00 migration/0
    4   ?        00:00:00 ksoftirqd/0
    5   ?        00:00:00 watchdog/0
    6   ?        00:00:00 events/0
    7   ?        00:00:00 cpuset
    8   ?        00:00:00 khelper
    9   ?        00:00:00 netns
   10   ?       00:00:00 async/mgr
   11   ?       00:00:00 pm
Note:Here the first column(PID) includes the process ids of all the running process.


How to find pid of a process by name
[root@server ~#]ps -e | grep <process name>
eg:  [root@server ~#]ps -e | grep vsftpd
1719   ?        00:00:00 vsftpd                  (pid of vsftpd is 1719)


And KILL the process
[root@server ~#]skill -p <pid>
eg:  [root@server ~#]skill -p 2152   




kill -9 <pid> worked perfectly.

man kill

Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...64&repo=addons error was

Quote:
Could not retrieve mirrorlist http://rpm.livna.org/mirrorlist error was
14: PYCURL ERROR 6 - ""
Error: Cannot retrieve repository metadata (repomd.xml) for repository: livna. Please verify its path and try again

when I try to use yum to install any package for eg VLC

Quote:
yum install vlc
I get

Quote:
Loaded plugins: presto, refresh-packagekit
fedora/metalink | 12 kB 00:01
fedora | 4.3 kB 00:00
fedora/primary_db | 773 kB
it goes on and I am not able to install anysoftware.

i tried

Quote:
yum clean metadata
&

Quote:
yum clean all
but was unable to resolve it. I m new to the platform and was unable to find a precise solution regarding it. Any help will be appreciated.

------------------------------------------------------------------


One possible solution is to use a fixed URL instead of the mirror list:
The original 'rpmfusion-free.repo' can look like :

Code:
[rpmfusion-free]
name=RPM Fusion for Fedora $releasever - Free
#baseurl=http://download1.rpmfusion.org/free/fedora/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch
Suggested edits for these lines (Example Fedora 14, i386)
Code:
baseurl=http://download1.rpmfusion.org/free/fedora/releases/14/Everything/i386/os/
# mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-$releasever&arch=$basearch
1) A fixed address. 2) Uncomment "mirrorlist.." with a hash mark ( # ).