I ran the following command in order to reinstall my broken apt-get system:-

sudo rm -vf /etc/apt/sources.list.d/*.list && sudo rm -vf /etc/apt/sources.list  

I was following the steps from this answer(Always getting error during apt-get install) but gksu package is not installed.

What are the next steps to follow now?

  • I have no idea what made you do that; but may I suggest not running a update command. Why did you consider your apt-get system broken? (possibly you were supposed to remove /var/lib/apt/lists/....) – guiverc Feb 28 '18 at 7:37
  • @guiverc I was getting similar errors (as asked in this askubuntu.com/questions/652603/…) on every installation. But since apt-get was not working properly, gksu and leafpad packages are not completely installed. Is there anything I can do now? – user8817816 Feb 28 '18 at 7:49
  • given you were following that answer, I'd continue with those steps. leadpad is only an editor, if it were me I'd type sudo vim ... (ie. used the vim editor; by default only vi is installed so if you've not used vim, substitute vi/nano/.. or whatever editor you like in place of leafpad). Please put info such as following (answer..) in your question.. [why sudo and not gksudo - mostly its what my fingers type :) ] ps: if you don't know vi/vim - try nano in place of leafpad (or gedit [if installed]) – guiverc Feb 28 '18 at 7:53
  • try using sudo instead of gksudo (and gksu) – guiverc Feb 28 '18 at 7:58
  • 1
    Yes it's working fine now. Thanks for the help. @guiverc – user8817816 Feb 28 '18 at 18:24

As @guiverc said, follow the answer you are following. You can use sudo instead of gksudo and any text editor(vim/gedit/sublime) instead of leafpad to paste that code. Just remember that due to use of #, askubuntu has converted a comment to bold line. Just insert # in front of every bold line (otherwise that the list cannot be read will keep coming) and don't copy that last line =============. You are good to go.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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