我是 ubuntu 新手,打开 sources.list 时意外创建了几个文档。例如,我有 sources.list、list 和无标题文档。我认为我的计算机现在无法知道它引用的是哪个文档,我在尝试下载 R 时遇到错误。您知道如何修复这个问题吗,这样我就只有一个名为 sources.list 的文档,里面有一个镜像可以下载软件包?
输出lsb_release -a
:
no LSB modules are available
Description: Ubuntu 15.04
Codename: vivid
输出apt cacher show r-base | grep ersion
WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts
输出ls /etc/apt/
:
apt.conf.d sources.list~ sources.list.save trusted.gpg~ preferences.d sources.list.d trusted.gpg trusted.gpg.d
输出sudo apt-get update
Type Rstudio is not known on line 33 in source list
the list of sources could not be read
的内容/etc/apt/sources.list
## 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.
## 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.
## 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 vivid partner
# deb-src http://archive.canonical.com/ubuntu vivid partner
Rstudio
deb http://mirror.evolvedservers.com/ubuntu-archive/ vivid main
deb http://archive.ubuntu.com/ubuntu vivid main universe restricted multiverse
答案1
如果你的 sources.list 文件损坏了。你可以尝试以下操作:
删除损坏的文件:
sudo rm /etc/apt/sources.list
sudo software-properties-gtk
然后勾选所有框,并更改“从...下载”服务器,这将创建一个新的 sources.list。
然后根据需要添加任何额外的存储库。
这对我有用。
这也是一个可以为您构建源列表的好工具。Ubuntu 源列表生成器:这里