3

I have recently started using Terminal, and I have been having lots of problems installing programs from the Ubuntu Software Center (Minecraft, TOR, Tails installer, etc.)

When I run sudo apt-get update I always get

N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension

I get a system error message when I boot up in relation to deb-src http://deb.torproject.org/torproject.org xenial main

When I try to open /etc/apt/sources.list with various commands it seems like it's not there, unless I open it with sudo gedit /etc/apt/sources.list, then I get a blank document

So my guess is I have accidentally removed it or something...

What do I do ?

Just an edit in response to Duplicate flags

The invalid file name is sorted now (it just needed removing). My problem now is adding lines to my sources list. I tried making a new file from one of the flagged duplicate threads I moved the file and made a new one with Gedit. It seemed to restore defaults and came up with 2x canonical brothers lines. And when I try to add a line nothing happens.

-Just found out when I use sudo su I can now add lines to my sources list

sudo su -c "echo 'deb http://www.duinsoft.nl/pkg debs all' >> /etc/apt/sources.list
Cristiana Nicolae
  • 4,570
  • 10
  • 32
  • 46

2 Answers2

3

Have you tried changing the repository to the 'Main server'? Whenever you change it and close, it will prompt you to reload. That should restore the defaults.

repositories in Software & Updates

If that does not work, here is a copy of mine:

deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial restricted universe main multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial-updates restricted universe main multiverse
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial-security restricted universe main multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security universe
deb http://archive.ubuntu.com/ubuntu xenial-security multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
wjandrea
  • 14,504
Aedazan
  • 312
1

#1 Fix for ignoring file

Removing the file should solve the problem, and may get rid of all the notices if the directory one is simply occurring because there are invalid files within it. Thus 50unattended-upgrades file should be removed.

 sudo rm /etc/apt/apt.conf.d/50unattended-upgrades.ucf-old

#2 Fix for missing /etc/apt/sources.list

Simply open Software & Updates via your Dash and you will see this

enter image description here Select desirable mirror, then activate checkbox to enable repositories (main, universe, restricted, multiverse) in order to create new sources.list file

Liso
  • 15,677