Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  50] [ 0]  / answers: 1 / hits: 119650  / 1 Year ago, sat, april 8, 2023, 3:02:09

Every once in a while I see users having issues to update due to errors like this:



E:Type 'ain' is not known on line 1 in source list /etc/apt/sources.list.d/some-ppa.list'


with varying types/line numbers/source list files (often after removing a PPA).



How can such an error be fixed?


More From » apt

 Answers
3

The error indicates a malformed entry in a source file, which causes the update process to abort. To fix it, you have to either fix the entry (if you know what the right entry should look like) or remove it altogether (that's what I'm going to describe, as it's the fastest way to enable you to update your system again).




  1. First, you need to open the file containing the bad entry. The filename is given in the error message, in your example /etc/apt/sources.list.d/some-ppa.list. Open a terminal, and type



    sudo nano /etc/apt/sources.list.d/some-ppa.list


    and press Enter. After entering your password, you should now see the file opened in the text editor nano.


  2. Now you need to locate the malformed entry. It should be on the line number given in the error message - in your case that would be line 1.


  3. This line should be incomplete and start with the unknown type the update process is complaining about (here ain). Just delete the whole line, and save/close the file with Ctrl+X.


  4. That's it. You should now be able to successfully run the update process!







If that entry is all that's in the file, then you can just delete the file. To do this, just open a terminal and run the following command:



sudo rm /etc/apt/sources.list.d/some-ppa.list

[#40852] Sunday, April 9, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
suitman

Total Points: 487
Total Questions: 105
Total Answers: 98

Location: India
Member since Wed, Aug 4, 2021
3 Years ago
;