I am trying to install packages on my linux OS using the command `apt-get install ...`.
The problem is that I get this error:

```
Selecting previously unselected package liberror-perl.
dpkg: unrecoverable fatal error, aborting:
 files list file for package 'java-common' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

```

Googling the error (even line by line), the solution SEEMS to be "to download and install missing packages to resolve dependencies" as it was point out [here](https://askubuntu.com/questions/551632/unable-to-install-anything-on-ubuntu-14-10-with-apt-get-says-files-list-file-for). The problem is that when I try to execute `sudo apt-get -f install` I continue to have the same error again and again. Any suggestion? How can I change the packages if I cannot use apt-get?