27
2011
10 things you didnt know about ‘apt’
If you are into the world of Linux or thinking of trying it out, you will most probably stumble upon apt. Due to the increase trend of people shifting to Debian distribution, apt now has become a must know tool.
In fact, apt-get will make your life so easy in Linux that you will stop worrying about how to install and remove software on the Debian GNU/Linux distributions.
So what’s apt?
APT or Advanced Package Tool is basically a Debian package management utility that works with core libraries to handle the installation and removal of software on the Debian GNU/Linux distribution and its variants.
In simple words, if you need to install , remove and update packages apt is the perfect tool for you.
1. Installing packages
Default use,
$ apt-get install < package-name >
e.g. $ apt-get install vlc
To choose a particular version,
$ apt-get install < package-name=1.1 >
For source packages,
$ apt-get source < package-name >
To compile the source packages after downloading them,
$ apt-get source -b <package-name>
2. Re-installing packages
$ apt-get –reinstall install < package-name >
3. Removing packages
$ apt-get remove < package-name > (Remember : this will not remove the configuration files)
for complete removal ( i.e. with configuration file )
$ apt-get –purge remove < package-name >
4. Upgrading packages
$ apt-get upgrade package-name
Upgrade all the packages which needs an upgrade,
$ apt-get -u upgrade
To add a CD to the source list
$apt-get cdrom
To upgrade the whole distribution to a new version,
$ apt-get dist-upgrade
5. Searching for packages
$ apt-cache search package-name
To list all the dependencies of a package and all the other packages that can fulfill that dependency,
$apt-cache depends package-name
6. Checking installed versions or decide the source
$apt-cache policy <package-name >
7. Show full description of a package
$apt-cache show package
8. Check for any broken dependencies
$ apt-get check
9. Clear the cached packages
$ apt-get clean (This command removes everything from the /var/cache/apt and /var/cache/apt/archives directory.)
10. Remove packages that can no longer be downloaded
$ apt-get autoclean
Options provided with apt-get
-f : fix broken dependencies
-m : continue if archives are unlocatable
-u : show a list of upgraded packages as well
-s : reports on the status of the package listed
For more information, visit http://wiki.debian.org/Apt or $apt-get –help
Try this when you are free, “This Apt has Super Cow Powers”
,
$ apt-get moo
Subscribe to fortystones.
Follow @fortystones on Twitter.
Get updated from our Facebook Fanpage.
Related Posts
7 Comments + Add Comment
Leave a comment
Fortystones Lab Projects
Categories
- Articles (43)
- Idea (2)
- Review (5)
- Social Media (29)
- Trending Topics (13)
- Collection (29)
- How To (27)
- Linux (26)
- News (15)
- PHP (6)
- Project (1)
- Tutorials (35)
- Java (4)
- Programming (10)
- Wordpress (7)
Popular Posts
- 40 Basic Linux Command-line Tips and Tricks
- Tips and Tricks for Facebook Chat (Save History/ Video Chat/ Send Files)
- The First on the World Wide Web
- 40 Linux Shell Commands for Beginners
- Online Coding Zones for Programmers
- Special: Facebook Smiley, Special Text Symbols and ASCII Arts
- 13 years of Google: 1997- Present

An article by






sudo apt-get autoremove should also be considered as it cleans the system by removing those files which are no longer in use.
I have not tried this but how do you define which file is ‘no longer in use’?
Great set of things on package tool, nice one, keep them coming!!..
That is a well formatted man page.
Why did you give up on examples after 1.1?
Unfortunately most people don’t show you how to use the man page, they simply show you how to access it. If you’re bright, you’ll figure it out on your own, but if you’re like me, it’ll take you a while to get what all the “-[word] –something” stuff means
I’ll not define the files, when you will type “sudo apt-get autoremove”, prompt itself will show message regarding files.