Please clean up sources.list (e.g., remove duplicated lines)

Bug #41290 reported by Stephen Martindale
22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt-setup (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

After installing Dapper from the install CD (2006-04-20) as a "Server Install", I noticed the following in sources.list:

- Most of the file had been duplicated inside itself. I found no less than FOUR lines listing the CD-Rom.
- The comments inside the file were scrappy at best.
- Several comment blocks appeared to be in the wrong place, for example, the backports comment *appeared* to refer to the third CD-Rom line in my file.

I selected "South Africa" as my location in the installer.

Revision history for this message
Stephen Martindale (charlie.) wrote :

Suggested Fix:

Fix duplicated lines.

Append a comment block to the top of the file, describing what the file is and where to find more information. This could include a pointer to the man page so that newbies know where to start looking. Append another block to the bottom of the file with a brief overview of the file's syntax. In this second block, disect the two standard lines that are nearly always in the file (dapper main restricted)

Suggestion:
## Package Resource List for APT
# The package resource list is used to locate archives of the package
# distribution system in use on the system.
#
# The source list is designed to support any number of active sources and
# a variety of source media. The file lists one source per line, with the
# most preferred source listed first. Lines or parts of lines may be
# marked as comments with the # (hash) character.
#
# More detailed information about the syntax of this file may be found at
# the end of this file or in sources.list(5)
#
# After editing this file, you should do "apt-get update" to resynchronize
# your package indexes.
#
# /etc/apt/sources.list
###

...
file content
...

## Source Line Syntax
#
# [type] [URI] [distribution] [component1 [component2 component3..]]
#
# type - Either "deb" or "deb-src", indicating whether the source
# provides packages or sources.
# URI - A Universal Resource Identifier (URI), which is a superset of the
# more specific and well-known Universal Resource Locator, or URL.
# See sources.list(5) for a detailed specification of this URI.
# distribution - The name of the distribution folder in the repository
# that the components are located in.
# components - One or more components that packages/sources should be
# downloaded from.
#
# Examples:
# This file ships with two lines similar to the following:
#
# deb http://archive.ubuntu.com/ubuntu/ dapper main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ dapper main restricted
#
# These two lines tell APT to download packages and sources from the
# 'main' and 'restricted' components found in the 'dapper' distribution
# at 'http://archive.ubuntu.com/ubuntu/', a Internet URL.
###

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

Could you please attach the sources.list (as it was written by apt-setup) to this bugreport? Did it only happend for a "server" install for you? Or for any install?

Thanks,
 Michael

Changed in apt-setup:
status: Unconfirmed → Needs Info
Revision history for this message
Michael Vogt (mvo) wrote : Sources.list after server install

This sources.list contains two cdrom lines (one commented out).

Changed in apt-setup:
status: Needs Info → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote : Re: sources.list is messy and contains duplicates

Michael, I don't think your sources.list is quite as bad as the reporter describes; I'd like to see the reporter's sources.list too.

Changed in apt-setup:
status: Confirmed → Needs Info
Revision history for this message
Stephen Martindale (charlie.) wrote :

If you read the bug report, you will note that mine contained FOUR CD-Rom lines - two commented and two uncommented.

Most of the other lines were duplicated.

I used the "Install a Server" option on the installer CD. In the past, I have installed the beta on another PC, using the same choices - the sources.list file on that PC was fine. The only notable difference between the two installs was that the PC on which sources.list was duplicated inside itself failed to validate the security repositories. (I retried at least once)

I suspect that retrying the validation of the repositories might have caused the script that generates sources.list to run twice, appending the output together.

Alas, the offending sources.list fell afoul of heavy editing on the scale of "sudo rm /etc/apt/sources.list"

Revision history for this message
Freddy Martinez (freddymartinez9) wrote :

Thank you for your report. Has this been fixed in later versions of Ubuntu? Has anyone new been able to reproduce this behavior?

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

The commented line (or lines, if a network install) are due to this in generators/01setup:

# add old file as comments
sed 's/^/# /' < $ROOT/etc/apt/sources.list | sed 's/^# # */# /' > $file

Changed in apt-setup:
status: Incomplete → Confirmed
Daniel T Chen (crimsun)
Changed in apt-setup:
importance: Medium → Wishlist
Revision history for this message
Chris Sherlock (ta-bu-shi-da-yu) wrote :

Any update on this bug?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.