Tag Archives: cli

Useful aptitude commands

A simple list of installed packages

max@wonko:~$ aptitude search '~i' -F '%p'

Search for installed packages from the testing repo

max@wonko:~$ aptitude versions '~i ~Atesting' --group-by=none

Finding why a package is installed

I found fonts-font-awesome in my headless server, but there’s a reason

max@wonko:~$ aptitude why fonts-font-awesome
i   owncloud Depends fonts-font-awesome

Select packages that were removed but not purged

max@wonko:~$ aptitude search '~c'

Search in the package description

max@wonko:~$ aptitude search '~d"web browser"'

Upgradable packages

max@wonko:~$ aptitude search '~U'
Android

How to find Android deprecated API

The problem

When you compile android apps, sometimes you can see this message:
-compile:
[javac] Compiling 12 source files to /home/max/Projects/Android/postphone/bin/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.

Now, how is possible to find the API call which seems to be deprecated?

The solution

$ ant -Djava.compilerargs=-Xlint:deprecation debug
The above command will show you what you were searching for:
[javac] /home/max/Projects/Android/xxx/src/net/mx17/xxx/Yyy.java:212: warning: [deprecation] getNotification() in android.support.v4.app.NotificationCompat.Builder has been deprecated
[javac] Notification notif = notificationBuilder.getNotification();