Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I wanted to install Numix icon theme, therefore I needed to add ppa, but it strangely raised this error:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 163, in <module>
    if not sp.add_source_from_shortcut(shortcut, options.enable_source):
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 750, in add_source_from_shortcut
    self.set_modified_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 484, in set_modified_sourceslist
    self.save_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 650, in save_sourceslist
    self.sourceslist.save()
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 415, in save
    files[source.file] = open(source.file, "w")
FileNotFoundError: [Errno 2] Böyle bir dosya ya da dizin yok: '/etc/apt/sources.list.d/numix-ppa-trusty.list'

From code, I understand Python wants to open a configuration file, but since it cannot find it, it cannot create it as well. (Or whatever...)

What is the source of this error? How to deal with it? And more, does Linux use Python for repository commands (since this is more interesting)?

I ran those codes:

sudo apt-add-repository ppa:numix/ppa
sudo apt-get update
sudo apt-get install numix-icon-theme numix-icon-theme-circle

OS: Xubuntu 14.04 LTS

EDIT: Editing sources.list

Whenever I run this code, I run across https://launchpad.net/~numix/+archive/ubuntu/ppa link. So I tried those in sources.list:

###############################################
# Number One: Add The Link To The End Of File #
###############################################
deb https://launchpad.net/~numix/+archive/ubuntu/ppa trusty partner
deb-src deb https://launchpad.net/~numix/+archive/ubuntu/ppa trusty partner
# I used "deb", "deb-src" and "trusty partner" patterns to achieve my goal, but it failed.

###################################
# Number Two: Change Link Pattern #
###################################
deb https://launchpad.net/~numix/+archive/ubuntu trusty partner
deb-src deb https://launchpad.net/~numix/+archive/ubuntu trusty partner
# I also tried those since other repository links ends with "ubuntu" instead of "ppa" but this also failed.
share|improve this question
    
I've never used add-apt-repository, but you realise you can just edit your sources file, right? It is /etc/apt/sources.list. –  Faheem Mitha Sep 11 at 19:15
    
Can you add the command you ran to the question? –  Mikel Sep 11 at 21:00
    
Edited. By the way, I know /etc/apt/sources.list, but how can I know what deb server of a PPA is? –  Eray Gezer Sep 11 at 21:03

1 Answer 1

up vote 0 down vote accepted

It seems that the directory /etc/apt/sources.list.d is missing from your system (you can confirm this with ls /etc/apt/sources.list.d, which should say "No such file or directory"). If this is indeed the case, recreate it with

sudo mkdir /etc/apt/sources.list.d

and try again.

share|improve this answer
    
This helped, thanks. :) –  Eray Gezer Sep 11 at 21:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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