-
-
Save davidfoerster/780daa8086b924b1837a06cc486af672 to your computer and use it in GitHub Desktop.
Migrated to https://github.com/davidfoerster/apt-remove-duplicate-source-entries |
on
running
sudo python3 apt-remove-duplicate-source-entries.py
showing error
Traceback (most recent call last):
File "apt-remove-duplicate-source-entries.py", line 8, in <module>
import aptsources.sourceslist
ImportError: No module named 'aptsources'
please suggest what to do
@yashhsethiya You are probably missing python-apt package.
sudo apt-get install python-apt
thanks, works fine, but runs as:
sudo python3 apt-remove-duplicate-source-entries.py
works for me... awesome
Thanks, works on Ubuntu 16.04
on Ubuntu 16.04 I get this result:
$ sudo python3 apt-remove-duplicate-source-entries.py
No duplicated entries were found.
[ But the following still happens... ]
$ sudo apt-get update
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://za.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://ppa.launchpad.net/deluge-team/ppa/ubuntu xenial InRelease
Hit:4 http://za.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 http://za.archive.ubuntu.com/ubuntu xenial-backports InRelease
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Translations (main/i18n/Translation-en_ZA) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Translations (universe/i18n/Translation-en_ZA) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Translations (main/i18n/Translation-en_ZA) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:55
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Translations (universe/i18n/Translation-en_ZA) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list:55
@SnaasebKram: Could you please file an issue report and provide a link to your /etc/apt/sources.list
? The comparison for duplicate entries is not perfect because I'm not exactly sure what entries Apt considers equal but a sample like yours would help tweaking that.
@yashhsethiya: You need to install the python3-apt
package. The most recent release makes that clearer.
@baudday thanks
I tried to run
/home/omegatron/Desktop/apt-remove-duplicate-source-entries.py
And it gave me this:
`omegatron@omegatron-Satellite-C655D:~$ /home/omegatron/Desktop/apt-remove-duplicate-source-entries.py
Overlapping source entries:
I disabled the latter entry.
1 source entries were disabled:
deb-src http://ubuntu.mirrors.linux.ro/archive/ xenial main multiverse universe #Added by software-properties
Do you want to save these changes? (y/N)
omegatron@omegatron-Satellite-C655D:~$
`
But when I tried
sudo apt-get update
it still gave me this:W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7 W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
Thanks again for any additional help.