5 apt tips and tricks

1) Search for a package name with apt-cache searchCan’t remember the exact package name but you know some of it? Make it easy on yourself and search using apt-cache. For example: apt-cache search FirefoxIt lists all results for your search. Nice and easy!It lists all results for your search. Nice and easy!2) Search for package information with apt-cache showWant details of a package before you install it? Simple just search for it with apt-cache show. apt-cache show firefoxMore details than you probably even wanted!More details than you probably even wanted!3) Upgrade only a specific packageSo you already know that you can upgrade your whole system by running apt-get upgradebut did you know you can upgrade a specific package instead of the whole system? It’s easy, just specify the package name in the upgrade command. For example to upgrade just firefox run: apt-get upgrade firefox4) Install specific package versionNormally when you apt-get install something you get the latest version available but what if that’s not what you wanted? What if you wanted a specific version of the package instead? Again, simple, just specify it when you run the install command. For example run: apt-get install firefox=versionWhere version is the version number you wish to install.5) Free up disk space with cleanWhen you download and install packages apt will automatically cache them on your hard drive. This can be useful for a number of reasons, for example some distributions use delta packages so that only what has changed between versions are re-downloaded. In order to do this it needs to have a base cached file already on your hard drive. However these files can take up a lot of space and often times don’t get a lot of updates anyway. Thankfully there are two quick commands that free up this disk space. apt-get clean apt-get autocleanBoth of these essentially do the same thing but the difference here is autoclean only gets rid of cached files that have a newer version also cached on your hard drive. These older packages won’t be used anymore and so they are an easy way to free up some space.There you have it, you are now officially 5 apt commands smarter. Happy computing!

Source: 5 apt tips and tricks | The Linux Experiment

Categories: Uncategorized

Post navigation

Comments are closed.

Blog at WordPress.com.

%d bloggers like this: