Tuesday, July 15, 2014

autoremove feature of Linux package management tools

Today, I was just trying to install inxi on my mint desktop and the aptitude not only told that its already installed but also figured out to provide the list of package no longer required by my desktop. This is something which is missing on yum in dependency resolution. This functionality is also available in yum on RedHat based distros.


it's called autoremove option in aptitude. see the output below.
From man page of apt-get

autoremove
autoremove is used to remove packages that were
automatically installed to satisfy dependencies for
other packages and are now no longer needed.


# apt-get install inxi
Reading package lists... Done
Building dependency tree 
Reading state information... Done
inxi is already the newest version.
The following packages were automatically installed and are no longer required
augeas-lenses cgroup-lite libaugeas0 libgtk-vnc-1.0-0 libgvnc-1.0-0
libnetcf1 libvirt0 python-gtk-vnc python-libvirt python-urlgrabber virtinst
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.

# apt-get autoremove
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following packages will be REMOVED:
augeas-lenses cgroup-lite libaugeas0 libgtk-vnc-1.0-0 libgvnc-1.0-0
libnetcf1 libvirt0 python-gtk-vnc python-libvirt python-urlgrabber virtinst
0 upgraded, 0 newly installed, 11 to remove and 25 not upgraded.
After this operation, 9,200 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 166773 files and directories currently installed.)
Removing libnetcf1 (1:0.2.3-4ubuntu1) ...
Removing libaugeas0 (1.2.0-0ubuntu1) ...
Removing augeas-lenses (1.2.0-0ubuntu1) ...
Removing cgroup-lite (1.9) ...
cgroup-lite stop/waiting
Removing python-gtk-vnc (0.5.3-0ubuntu2) ...
Removing libgtk-vnc-1.0-0 (0.5.3-0ubuntu2) ...
Removing libgvnc-1.0-0 (0.5.3-0ubuntu2) ...
Removing virtinst (0.600.4-3ubuntu2) ...
Removing python-libvirt (1.2.2-0ubuntu1) ...
Removing libvirt0 (1.2.2-0ubuntu13.1) ...
Removing python-urlgrabber (3.9.1-4ubuntu3) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Processing triggers for man-db (2.6.7.1-1) ...
Share:

Saturday, March 1, 2014

unusual file system usage in linux

If you ever come across a situation where the df command and du commands reporting different size of the same file system. The main cause of this are the files being written by applications after the files have been deleted by users on the file system. du/ls command will not show these files. Hence the conflict between du and df. You can view those files using lsof |grep deleted command. Then you can kill those processes or restart the concerned application to reclaim space.

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv
50G 16G 32G 34% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 504M 121M 358M 26% /boot
/dev/sda2
104G 96G 2.8G 98% /local
# du -sh /local
11G /local

# lsof |grep deleted
httpd 477 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 865 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 1312 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 1393 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 1532 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 2022 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 2640 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 2763 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 2909 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 3047 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
httpd 3048 root 5w REG 253,2 90780834079 9848484 /local/access.log (deleted)
Share:

Sunday, February 16, 2014

zfs acl management

You can view the existing acls on zfs filesystem using below command

#ls -Vd DirectoryName

To add acl

#chmod -R A0+user:odeas:rwx:allow DirectoryName

To delete acl

#chmod -R A0- DirectoryName

where 0 is the acl ID

-R flag is for recursive permissions
Share:

Monday, January 13, 2014

recover system after /boot partition is deleted on linux

recover your system in the event of /boot partition lost/ deletion/ or accidental rm of all files under /boot

if you face such scenario at your any centos / rhel /fedora systems. don't panic you can still recover your system , just follow the below steps -



1. boot your system using rescue mode available on centos dvd or cd ISO
2. now chroot to the mounted the filesystem
3. go to the cdrom mount under /media and go to where rpm's are stored (/media/cdrom/Packages) 
4. install kernel, grub and redhat-logs rpms using --force parameter
5. generate initrd using mkinitrd command 6. create a new /boot/grub/grub.conf file per example below

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS
root (hd0,0)
kernel /vmlinuz-2.6.279-164.el6 ro root=
initrd /initrd-2.6.279-164.el6.img@@

7. make a softlink
#ln -s /boot/grub/grub.conf /boot/grub/menu.lst

Note : make sure you have correct UUID or parition label
Share:

Copyright © My Learning Journey | Powered by Blogger

Design by Anders Norén | Blogger Theme by NewBloggerThemes.com