在Ubuntu 18.04 LTS(Bionic Beaver)中,/etc/apt/sources.list的默认内容是什么?

在Ubuntu 18.04 LTS(Bionic Beaver)中,我可以在哪里找到/etc/apt/sources.list的默认内容?
使用命令cat /etc/apt/sources.list可以显示。
deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe deb-src http://in.archive.ubuntu.com/ubuntu/ bionic multiverse restricted universe main #Added by software-properties # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the ## distribution. deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-updates multiverse restricted universe main #Added by software-properties # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial universe # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://in.archive.ubuntu.com/ubuntu/ bionic multiverse # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial multiverse deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates multiverse # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://in.archive.ubuntu.com/ubuntu/ bionic-backports main restricted multiverse universe deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-backports main restricted multiverse universe #Added by software-properties # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu xenial partner # deb-src http://archive.canonical.com/ubuntu xenial partner deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse restricted universe main #Added by software-properties # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted # deb-src http://security.ubuntu.com/ubuntu xenial-security universe deb http://security.ubuntu.com/ubuntu bionic-security multiverse # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse # deb https://pkg.jenkins.io/debian-stable binary/

如果你想要用一个“默认”的文件替换你当前的文件,这个链接可能会对你有所帮助:https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories。不过,具体来说,你想要做什么呢? - hiigaran
我想从sources.list中删除不必要的行。 - Dipankar
在这种情况下,最好的做法是在图形用户界面软件更新程序中更改您的设置(服务器位置、要查找的存储库等),然后打开 sources.list 文件并删除以 # 开头的任何行。这些行被注释掉,并且基本上被禁用了。如果以后需要更改任何设置,可以重新添加这些行。 - hiigaran
2你如何定义不必要的内容?我认为默认情况下文档行是必要的,而被注释掉的源码行(因此被禁用)以及目前未启用的仓库对我来说也是文档。 - guiverc
是的,我知道“#”代表注释掉的意思。是的,“necessary”就是Ubuntu文档所说的意思。我在搜索Ubuntu官方文档,但是没有找到。 - Dipankar
1个回答

只要你想从你的sources.list中删除不需要的行,下面是一个示例,展示了你文件内容可能包含的内容:
deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://in.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse

deb-src http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse

这是基于您提供的未被注释掉的sources.list内容。为了减少行数,一些内容已经合并。另外,如果您不需要源代码,可以删除所有的deb-src行。
话虽如此,除了可读性之外,并没有太大的意义去做这个操作。被注释掉的部分不会对任何事情产生影响,而有些行提供了信息给您。如果您确定不需要它们,可以继续使用上面提供的行。

是的。我知道“#”代表注释掉的内容。我在搜索Ubuntu官方文档,但未找到相关信息。 - Dipankar
谢谢!这对我有用 :) - HV Sharma