I am running Ubuntu 16.04 and new to Ubuntu. Please let me know what I did wrong:
In my system a sources.list~ file and also a trusted.gpg~ file was generated.


You did nothing wrong - every time when you edit the sources.list file or when you add or remove a repository, a backup of the old .list file gets generated with the ~ suffix, so in case you want to revert something later on, you can delete the new file and rename the old file by removing the "tilde".

If you don't want to keep the backup file, you can delete it by executing one of these commands :

  • sudo rm /etc/apt/sources.list~
  • sudo rm /etc/apt/sources.list.d/<repository-file-name>.list~

The same you can do with the trusted.gpg~ file when you don't want to keep it in the system.

  • but unknowingly I was deleted my source.list~ and trusted.list~ yesterday. So I will check and see when I add any repository next time. Thank you sir. – AtmanSangeetha Dec 28 '17 at 2:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.