您尚未登录。

#1 2019-05-07 13:12:43

AWACS
会员
注册时间: 2019-05-07
帖子: 2

刚刚装完arch 打算更新时 pacman显示" all directives must belong to a section" 怎么办

如题,我尝试用iso修复 但是挂载了识别不了  虚拟机的
#
#/etc/pacman.conf
#
#See the pacman.conf(5) manpage for option and repository directives


#
#GENERAL OPTIONS
#
[options]
#The following paths are commented out with their default valueslisted.
#If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand= /usr/bin/curl -C - -f %u > %o
#XferCommand= /usr/bin/wget --passive-ftp -c -o %o %u
#CleanMethod= KeepInstalled
#UseDelta = 0.7
Architecture= auto


#Pacman won't upgrade packages listed in IgnorePkg and members ofIgnoreGroup
#IgnorePkg =
#IgnoreGroup=


#NoUpgrade =
#NoExtract    =

#Misc options
#UseSyslog
#Color
#TotalDownload
CheckSpace
#VerbosePkgLists


#By default, pacman accepts packages signed by keys that its localkeyring
#trusts (see pacman-key and its man page), as well as unsignedpackages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel= Optional
#RemoteFileSigLevel= Required


#NOTE: You must run `pacman-key --init` before first using pacman; thelocal
#keyring can then be populated with the keys of all official ArchLinux
#packagers with `pacman-key --populate archlinux`.


#
#REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
#Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
#The header [repo-name] is crucial - it must be present and
#uncommented to enable the repo.
#


#The testing repositories are disabled by default. To enable,uncomment the
#repo name header and Include lines. You can add preferred serversimmediately
#after the header, and they will be used before the default mirrors.


#[testing]
#Include= /etc/pacman.d/mirrorlist


[core]
Include= /etc/pacman.d/mirrorlist


[extra]
Include= /etc/pacman.d/mirrorlist


#[community-testing]
#Include= /etc/pacman.d/mirrorlist


[community]
Include= /etc/pacman.d/mirrorlist


#If you want to run 32 bit applications on your x86_64 system,
#enable the multilib repositories as required here.


#[multilib-testing]
#Include= /etc/pacman.d/mirrorlist


[multilib]
Include= /etc/pacman.d/mirrorlist


#An example of a custom package repository. See the pacman manpagefor
#tips on creating your own repositories.
[custom]
SigLevel= Optional TrustAll
Server= file:///home/custompkgs

[archlinux]
Server=https://mirrors.ustc.edu.cn/archlinuxcn/$arch

离线

#2 2019-05-07 16:55:54

Kurobac
小白
注册时间: 2018-05-12
帖子: 85

Re: 刚刚装完arch 打算更新时 pacman显示" all directives must belong to a section" 怎么办

你用什么编辑器编辑的文件?

[custom]
SigLevel= Optional TrustAll
Server= file:///home/custompkgs

[archlinux]
Server=https://mirrors.ustc.edu.cn/archlinuxcn/$arch

这里的第一个custom是个例子,如果你没在那个目录建立repo的话就注释掉
还有下边那个是archlinuxcn


# pacman -Syu

离线

#3 2019-05-07 17:07:53

AWACS
会员
注册时间: 2019-05-07
帖子: 2

Re: 刚刚装完arch 打算更新时 pacman显示" all directives must belong to a section" 怎么办

我用的是vim  然后之前也没动过那个文件  现在我重装算了  只是想知道原因

离线

#4 2019-05-07 20:13:00

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,917
个人网站

Re: 刚刚装完arch 打算更新时 pacman显示" all directives must belong to a section" 怎么办

AWACS 说:

我用的是vim  然后之前也没动过那个文件  现在我重装算了  只是想知道原因

我们能知道的就和报错消息所说的一样:你开头有不属于任何节的内容。
至于是怎么造成的,就只有你自己清楚了。

离线

#5 2019-05-08 09:19:06

Mr.I
路人丙
所在地: Kerbal
注册时间: 2015-08-29
帖子: 308

Re: 刚刚装完arch 打算更新时 pacman显示" all directives must belong to a section" 怎么办

依云 说:

我们能知道的就和报错消息所说的一样:你开头有不属于任何节的内容。


但是楼主的配置文件的格式看起来似乎没有什么问题啊,难道是有 BOM 头?

最近编辑记录 Mr.I (2019-05-08 09:24:53)

离线

#6 2019-05-08 21:26:02

luxni
会员
注册时间: 2014-06-08
帖子: 281

Re: 刚刚装完arch 打算更新时 pacman显示" all directives must belong to a section" 怎么办

应该是文件的编码问题吧,里面的文本貌似被 “格式化(format)” 了一样,字数长的都挤在一起了。


虽然人菜菜的,但也想做个有趣的人。

离线

页脚