Ubuntu Linux comes with a good package management system, apt. Once you familiar with it, it is really easy to use.
There’re several front-end interface to this package management system, including aptitude, the command line interface, synaptic, the GUI application for X Window System and apt-get, the command line package handling utility.
- Install All Latest Updates
apt-get update //refresh available updates apt-get upgrade //upgrade all packages
- Install a New Version of Ubuntu
apt-get update apt-get dist-upgrade
Install/Uninstall New Software Packages
- If you know the package nameFor installation, enter the following command,
sudo apt-get install <pkg>
For uninstallation, enter the following command,
sudo apt-get purge <pkg>
sudo apt-get remove <pkg>
- If you don’t know the package name exactly, use the aptitude search function,
sudo aptitude search <whatever-what-know>
The system will return a list of packages, then you can use commands mentioned above to install the package you want.
- If there’re broken packages in your system, fix the broken packages by entering the command,
sudo apt-get -f install
Get the Source Code for Compiling the Software Package
- Get the package source code by entering the following command,
sudo apt-get source <pkg>
- Get other packages needed to build this package
sudo apt-get build-dep <pkg>
- If you haven’t installed the build tools yet, install them by entering the command,
sudo apt-get build-essential
- follow the compilation guideline of the package to compile the package. Normally what you’ll need to do is, (in case you don’t have permission for any steps below, add sudo in front)
cd <pkg-directory> ./configure make make install
Download without Installing Software Package
- Sometimes you might just want to download the package and pass it to your friend who doesn’t have a Internet connection,
sudo aptitude download <pkg>
The .deb installation package will be downloaded to your current directory.