pacman 错误:未能同步所有数据库(软件仓库没有配置服务器信息)

carrot@myArch ~]$ sudo pacman -Syu
[sudo] carrot 的密码:
:: 正在同步软件包数据库...
错误:未能同步所有数据库(软件仓库没有配置服务器信息)
[carrot@myArch ~]$ sudo pacman -v
警告:database file for 'core' does not exist (use '-Sy' to download)
警告:database file for 'extra' does not exist (use '-Sy' to download)
警告:database file for 'multilib' does not exist (use '-Sy' to download)
警告:database file for 'custom' does not exist (use '-Sy' to download)
Root      : /
Conf File : /etc/pacman.conf
DB Path   : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/  
Hook Dirs : /usr/share/libalpm/hooks/  /etc/pacman.d/hooks/  
Lock File : /var/lib/pacman/db.lck
Log File  : /var/log/pacman.log
GPG Dir   : /etc/pacman.d/gnupg/
Targets   : 无
错误:没有指定操作 (使用 -h 获取帮助) 
[carrot@myArch ~]$ cat /etc/pacman.d/mirrorlist 
##
## Arch Linux repository mirrorlist
## Generated on 2026-01-18
##
#--------------------------------------------------------------------------
# China  
Server = [url]https://mirrors.aliyun.com/archlinux/$repo/os/$arch[/url]  
Server = [url]https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch[/url]  
Server = [url]https://mirrors.cloud.tensent.com/archlinux/$repo/os/$arch[/url]  
Server = [url]https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch[/url]  
Server = [url]https://repo.huaweicloud.com/archlinux/$repo/os/$arch[/url]  
Server = [url]https://mirrors.sjtug.sjtu.edu.cn/archlinux/$repo/os/$arch[/url]  
Server = [url]http://mirrors.163.com/archlinux/$repo/os/$arch[/url]  
# Sys  
Server = [url]http://mirrors.163.com/archlinux/$repo/os/$arch[/url]  
Server = [url]https://archlinux.thaller.ws/$repo/os/$arch[/url]  
Server = [url]https://at.arch.mirror.kescher.at/$repo/os/$arch[/url]  
Server = [url]https://de.arch.mirror.kescher.at/$repo/os/$arch[/url]  
Server = [url]https://mirror.theo546.fr/archlinux/$repo/os/$arch[/url]  
Server = [url]https://berlin.mirror.pkgbuild.com/$repo/os/$arch[/url]  
Server = [url]https://london.mirror.pkgbuild.com/$repo/os/$arch[/url]  
Server = [url]https://losangeles.mirror.pkgbuild.com/$repo/os/$arch[/url]  
Server = [url]https://singapore.mirror.pkgbuild.com/$repo/os/$arch[/url]  
Server = [url]https://taipei.mirror.pkgbuild.com/$repo/os/$arch[/url]  
Server = [url]https://mirror.ufscar.br/archlinux/$repo/os/$arch[/url]  
Server = [url]https://mirror.moson.org/arch/$repo/os/$arch[/url]  
Server = [url]https://al.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://at.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://de.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://in.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://nz.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://ro.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://tr.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://us.arch.niranjan.co/$repo/os/$arch[/url]  
Server = [url]https://mirror.osbeck.com/archlinux/$repo/os/$arch[/url]

看看你的/etc/pacman.conf

另外这个[url]是怎么回事?真的被写在配置文件里的吗?

[carrot@myArch ~]$ cat /etc/pacman.conf 
#
# /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 values listed.
# 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 -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

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

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
#Color
#NoProgressBar
CheckSpace
#VerbosePkgLists
ParallelDownloads = 5
DownloadUser = alpm
#DisableSandboxFilesystem
#DisableSandboxSyscalls

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

# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# 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 servers immediately
# after the header, and they will be used before the default mirrors.

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

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

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

[extra]
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 manpage for
# tips on creating your own repositories.
[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

#[archlinuxcn]
#Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch # 中国科学技术大学开源镜像站
#Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch # 清华大学开源软件镜像站
#Server = https://mirrors.hit.edu.cn/archlinuxcn/$arch # 哈尔滨工业大学开源镜像站
#Server = https://repo.huaweicloud.com/archlinuxcn/$arch # 华为开源镜像站
[carrot@myArch ~]$ 
carrot@myArch ~]$ cat /etc/pacman.d/mirrorlist 
##
## Arch Linux repository mirrorlist
## Generated on 2026-01-18
##
#--------------------------------------------------------------------------
# China  
Server = https://mirrors.aliyun.com/archlinux/$repo/os/$arch  
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch  
Server = https://mirrors.cloud.tensent.com/archlinux/$repo/os/$arch  
Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch  
Server = https://repo.huaweicloud.com/archlinux/$repo/os/$arch  
Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux/$repo/os/$arch  
Server = http://mirrors.163.com/archlinux/$repo/os/$arch  
# Sys  
Server = http://mirrors.163.com/archlinux/$repo/os/$arch  
Server = https://archlinux.thaller.ws/$repo/os/$arch  
Server = https://at.arch.mirror.kescher.at/$repo/os/$arch  
Server = https://de.arch.mirror.kescher.at/$repo/os/$arch  
Server = https://mirror.theo546.fr/archlinux/$repo/os/$arch  
Server = https://berlin.mirror.pkgbuild.com/$repo/os/$arch  
Server = https://london.mirror.pkgbuild.com/$repo/os/$arch  
Server = https://losangeles.mirror.pkgbuild.com/$repo/os/$arch  
Server = https://singapore.mirror.pkgbuild.com/$repo/os/$arch  
Server = https://taipei.mirror.pkgbuild.com/$repo/os/$arch  
Server = https://mirror.ufscar.br/archlinux/$repo/os/$arch  
Server = https://mirror.moson.org/arch/$repo/os/$arch  
Server = https://al.arch.niranjan.co/$repo/os/$arch  
Server = https://at.arch.niranjan.co/$repo/os/$arch  
Server = https://de.arch.niranjan.co/$repo/os/$arch  
Server = https://in.arch.niranjan.co/$repo/os/$arch  
Server = https://nz.arch.niranjan.co/$repo/os/$arch  
Server = https://ro.arch.niranjan.co/$repo/os/$arch  
Server = https://tr.arch.niranjan.co/$repo/os/$arch  
Server = https://us.arch.niranjan.co/$repo/os/$arch  
Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch
[carrot@myArch ~]$ sudo pacman -Syuu
:: 正在同步软件包数据库...
错误:未能同步所有数据库(软件仓库没有配置服务器信息)
[carrot@myArch ~]$ 

[url][/url]可能在复制时不小心加入了标签,删除后重启系统问题依旧存在

实际上我已经安装好了系统和KDE桌面环境了。昨天下载了一些KDE桌面商店的程序,有些成功安装了,有些进度一直是0%,这个时候我就发现我的pacman没法用了。之后我就尝试更换了一些软件源,问题一直没有解决。

file /etc/pacman.conf /etc/pacman.d/mirrorlist看看呢?

那个custom没注释掉

对哦,在这儿呢。

火眼金睛!