26 August, 2016

useful ubuntu/debian commands for sys-Admin

  • To clean the cache from system which apt caches when we update/install the packages
apt-get clean 
    •   To downloads  packages list from repository and update them,to get data on latest available packages
    apt-get update 
      •  To install specific version of  package
      apt-get install package-name 
      • To check OS version   
      Ex : lsb_release -a
        • To provides the package's description, its dependencies, the name of its maintainer. apt search, apt show, aptitude search, aptitude show work in the similar manner
        Ex : apt-cache search php5-fpm
          • The checkrestart program tries to determine if there are  processes  in the  system  that  need to be restarted after a system upgrade .Consequently, checkrestart is sometimes used as an audit tool  to  find outdated  versions  of  libraries  in  use, particularly after security upgrades

          Ex : checkrestart -h
            •  List all installed packages, along with package version and short details.
            Ex : dpkg -l php5-fpm
            • To check OS version 
            Ex : lsb_release -a
              • To check memcache version on debian
              Ex : telnet localhost 11211;and type 'version'

                • To check openssl version on debian
                Ex : openssl version -a OR dpkg-query -l | grep openssl

                  • To know the date on which current version of OpenSSL was built
                  Ex : openssl version -a OR dpkg-query -l | grep openssl

                    • To check auto update is enable
                    Ex : apt-get install unattended-upgrades and look into the files /etc/apt/apt.conf.d/10periodic /etc/apt/apt.conf.d/20auto-upgrades
                    • To check available packages in Debian/ubuntu
                    Ex : apt-cache policy openssl
                      • To check Loaded configuration files in Ubuntu
                      Ex : php --ini OR php -i | grep 'php.ini'
                        • To get glibc version
                        Ex : ldd --version
                          • To start a daemon at startup
                          Ex : update-rc.d service_name defaults
                            • To remove a daemon at startup
                            Ex : aupdate-rc.d -f service_name remove
                              • To check apache using which module perfork or worker 
                              Ex : apache2ctl -l OR apache2ctl -M
                                • To add CD-rom as repository
                                Ex : openssl version -a OR dpkg-query -l | grep openssl