12:20 PM Backtrack 5 apt-get package management cheat sheet | Ethical Hacking in Chandigarh | |
Working on backtrack 5 which is basnde on debin linux platform hence required packages to install having .deb extension. so Here is a list of debin packages that you can follow. (1) apt-get : APT is acronym for Advanced Package Tool. It supports installing packages over internet (ftp or http). You can also upgrade all packages in single operations, which makes it even more attractive. (2) dpkg : Debian packaging tool which can be use to install, query, uninstall packages. (3) Gui tools:You can also try GUI based or high level interface to the Debian GNU/Linux package system. Following list summaries them: Red hat Linux package names generally end in .rpml similarly Debian package names end in .deb, for example: apache : Package name Remember whenever I refer .deb file it signifies complete file name, and whenever I refer package name it must be first part of .deb file. For example when I refer to package sudo it means sudo only and not the .deb file i.e. sudo_1.6.7p5-2_i386.deb. However do not worry you can find out complete debian package list with the following command: apt-get add a new packageAdd a new package called samba # apt-get install samba
apt-get remove the package called samba but keep the configuration filesSyntax: apt-get remove {package-name} # apt-get remove samba
apt-get remove (erase) package and configuration fileSyntax: apt-get --purge remove {package-name} # apt-get --purge remove samba
apt-get Update (upgrade) packageSyntax: apt-get upgrade To upgrade individual package called sudo, enter: apt-get display available software updatesFollowing command will display the list of all available upgrades (updates) using -u option, if you decided to upgrade all of the shown packages just hit 'y' # apt-get upgrade samba
However if you just wish to upgrade individual package then use apt-get command and it will take care of rest of your worries: dpkg command to get package information such as description of package, version etc.Syntax: dpkg --info {.deb-package-name} # dpkg --info sudo_1.6.7p5-2_i386.deb | less
List all installed packagesSyntax: dpkg -l # dpkg -l
To list individual package try such as apache# dpkg -l apache
You can also use this command to see (verify) if package sudo is install or not (note that if package is installed then it displays package name along with small description): # dpkg -l | grep -i 'sudo'
To list packages related to the apache: # dpkg -l '*apache*'
List files provided (or owned) by the installed package (for example what files are provided by the installed samba package) # dpkg -L samba
(H) List files provided (or owned) by the package (for example what files are provided by the uninstalled sudo package) # dpkg --contents sudo_1.6.7p5-2_i386.deb
Find, what package owns the file /bin/netstat?Syntax: dpkg -S {/path/to/file} # dpkg -S /bin/netstat
Search for package or package descriptionSome times you don’t know package name but aware of some keywords to search the package. Once you got package name you can install it using apt-get -i {package-name} command: Find out all the Debian package which can be used for Intrusion Detection# apt-cache search "Intrusion Detection"
Find out all sniffer packages # apt-cache search sniffer
Find out if Debian package is installed or not (status)Syntax: dpkg -s {package-name} | grep Status # dpkg -s samba| grep Status
List ach dependency a package has...Display a listing of each dependency a package has and all the possible other packages that can fulfill that dependency. You hardly use this command as apt-get does decent job fulfill all package dependencies. Display dependencies for lsof and mysql-server packages: # apt-cache depends lsof# apt-cache depends mysql-server
| |
|