Useful APT
» Articles / Code » Server Configuration » Useful APT
Apt and dpkg are the package managers for Debian and Ubuntu distro's. Most common uses are apt-get install <package> or apt-get remove <package>. But there is some more you can do. For example make a list of all packages on your system, then install the same packages on a target system.
dpkg --get-selections
will give you a full list of installed package. You can also use
dpkg -l
returns a similar list, but shows some more info
if you write the output of to a file, then it could be used together with --set-selection to install all packages on another machine
cat packagelist.txt | dpkg --set-selections
followed by
apt-get dselect-upgrade
This way you can easily synchronise all package on different machines.
dpkg -L <package>
-L is a handy parameter to dpkg which will show you what files a package will install.
If you want to have a quick look at what some uninstalled package might be, the use
apt-get search <package>
or if you are a lazy coder, add this to your .bashrc file:
function apts()
{apt-cache search $1
}
so all you have to type is
apts <package>
Post your comment
Comments
No one has commented on this page yet.
RSS feed for comments on this page | RSS feed for all comments