AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 877829
Accepted
mark
mark
Asked: 2017-01-31 00:32:30 +0800 CST2017-01-31 00:32:30 +0800 CST 2017-01-31 00:32:30 +0800 CST

警告:root:无法打开文件'/etc/apt

  • 772
vegan@vegan:~$ yo -v
WARNING:root:could not open file '/etc/apt/sources.list.d/midori-ubuntu-ppa-xenial.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/git.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/yandex-browser-beta.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/webupd8team-ubuntu-java-xenial.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/yandex-browser.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/nodesource.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/google-chrome.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/notepadqq-team-ubuntu-notepadqq-xenial.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/apandada1-ubuntu-brightness-controller-xenial.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/opera-stable.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/justinludwig-ubuntu-tzdata-xenial.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/maarten-baert-ubuntu-simplescreenrecorder-xenial.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/docker.list'
WARNING:root:could not open file '/etc/apt/sources.list.d/slack.list'
yo: command not found

那些来自update.

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

vegan@vegan:~$ sudo apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Ign:2 http://archive.ubuntu.com/ubuntu precise InRelease
Get:3 http://security.ubuntu.com/ubuntu precise-security InRelease [55,7 kB]
Hit:4 http://dl.google.com/linux/chrome/deb stable Release                     
Get:5 http://archive.ubuntu.com/ubuntu precise-updates InRelease [55,7 kB]       
Hit:6 https://deb.nodesource.com/node_5.x xenial InRelease                       
Hit:8 http://archive.ubuntu.com/ubuntu precise-backports InRelease               
Hit:9 http://archive.ubuntu.com/ubuntu precise Release
Fetched 111 kB in 0s (115 kB/s)
Reading package lists... Done
W: http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: http://archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: http://archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
vegan@vegan:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  tzdata-java
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

这是/etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu precise universe main multiverse restricted

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

# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main

这也是

    vegan@vegan:~$ ls -l /etc/apt/sources.list.d
ls: cannot access '/etc/apt/sources.list.d/nodesource.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/git.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/google-chrome.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/midori-ubuntu-ppa-xenial.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/opera-stable.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/git.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/webupd8team-ubuntu-java-xenial.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/yandex-browser.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/yandex-browser-beta.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/yandex-browser-beta.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/webupd8team-ubuntu-java-xenial.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/yandex-browser.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/nodesource.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/google-chrome.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/notepadqq-team-ubuntu-notepadqq-xenial.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/midori-ubuntu-ppa-xenial.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/maarten-baert-ubuntu-simplescreenrecorder-xenial.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/apandada1-ubuntu-brightness-controller-xenial.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/docker.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/opera-stable.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/justinludwig-ubuntu-tzdata-xenial.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/apandada1-ubuntu-brightness-controller-xenial.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/slack.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/notepadqq-team-ubuntu-notepadqq-xenial.list.save': Permission denied
ls: cannot access '/etc/apt/sources.list.d/justinludwig-ubuntu-tzdata-xenial.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/maarten-baert-ubuntu-simplescreenrecorder-xenial.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/docker.list': Permission denied
ls: cannot access '/etc/apt/sources.list.d/slack.list': Permission denied
total 0
-????????? ? ? ? ?            ? apandada1-ubuntu-brightness-controller-xenial.list
-????????? ? ? ? ?            ? apandada1-ubuntu-brightness-controller-xenial.list.save
-????????? ? ? ? ?            ? docker.list
-????????? ? ? ? ?            ? docker.list.save
-????????? ? ? ? ?            ? git.list
-????????? ? ? ? ?            ? git.list.save
-????????? ? ? ? ?            ? google-chrome.list
-????????? ? ? ? ?            ? google-chrome.list.save
-????????? ? ? ? ?            ? justinludwig-ubuntu-tzdata-xenial.list
-????????? ? ? ? ?            ? justinludwig-ubuntu-tzdata-xenial.list.save
-????????? ? ? ? ?            ? maarten-baert-ubuntu-simplescreenrecorder-xenial.list
-????????? ? ? ? ?            ? maarten-baert-ubuntu-simplescreenrecorder-xenial.list.save
-????????? ? ? ? ?            ? midori-ubuntu-ppa-xenial.list
-????????? ? ? ? ?            ? midori-ubuntu-ppa-xenial.list.save
-????????? ? ? ? ?            ? nodesource.list
-????????? ? ? ? ?            ? nodesource.list.save
-????????? ? ? ? ?            ? notepadqq-team-ubuntu-notepadqq-xenial.list
-????????? ? ? ? ?            ? notepadqq-team-ubuntu-notepadqq-xenial.list.save
-????????? ? ? ? ?            ? opera-stable.list
-????????? ? ? ? ?            ? opera-stable.list.save
-????????? ? ? ? ?            ? slack.list
-????????? ? ? ? ?            ? slack.list.save
-????????? ? ? ? ?            ? webupd8team-ubuntu-java-xenial.list
-????????? ? ? ? ?            ? webupd8team-ubuntu-java-xenial.list.save
-????????? ? ? ? ?            ? yandex-browser-beta.list
-????????? ? ? ? ?            ? yandex-browser-beta.list.save
-????????? ? ? ? ?            ? yandex-browser.list
-????????? ? ? ? ?            ? yandex-browser.list.save

还

vegan@vegan:~$ ls -l /etc/apt
total 92
drwxr-xr-x 2 root root  4096 Oca 18 10:14 apt.conf.d
-rw-r--r-- 1 root root  2144 Şub 18  2016 apt-file.conf
drwxr-xr-x 2 root root  4096 Nis 14  2016 preferences.d
-rw-r--r-- 1 root root   668 Oca 29 17:52 sources.list
drw-r--r-- 2 root root  4096 Oca 25 15:22 sources.list.d
-rw-rw-r-- 1 root root  2979 Oca  2 09:37 sources.list.save
-rw-r--r-- 1 root root 31967 Oca 18 09:59 trusted.gpg
-rw-r--r-- 1 root root 31594 Kas 30 10:23 trusted.gpg~
drwxr-xr-x 2 root root  4096 Oca  2 09:37 trusted.gpg.d
apt
  • 2 2 个回答
  • 13720 Views

2 个回答

  • Voted
  1. Best Answer
    Melebius
    2017-01-31T04:19:19+08:002017-01-31T04:19:19+08:00

    该目录/etc/apt/sources.list.d缺少执行权限 ( x)。需要打开一个目录。使用以下方法恢复它:

    sudo chmod +x /etc/apt/sources.list.d
    

    也可以看看

    • https://www.linux.com/learn/understanding-linux-file-permissions
    • 4
  2. pldg
    2019-04-08T14:14:26+08:002019-04-08T14:14:26+08:00

    如果您可以访问/etc/apt/sources.list.d但仍然收到该文件夹​​内文件的警告,例如WARNING:root:could not open file '/etc/apt/sources.list.d/yarn.list',您必须将该特定文件的权限更改为-rw-r--r--,您可以使用sudo chmod 644 /etc/apt/sources.list.d/nodesource.list.

    • 0

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve