Flatpak install error

when i try to install flatpak .i get this error

vig@vig-81vd ~]$ sudo pacman -S flatpak
warning: database file for 'flatpak' does not exist (use '-Sy' to download)
error: failed to prepare transaction (could not find database)
[vig@vig-81vd ~]$ sudo pacman -Sy flatpak
:: Synchronizing package databases...
 endeavouros is up to date
 core is up to date
 extra is up to date
 multilib is up to date
 flatpak.db failed to download
error: failed retrieving file 'flatpak.db' from dl.flathub.org : URL rejected: Malformed input to a URL function
error: failed to synchronize all databases (unexpected error)

I did update the mirror list but it didn’t fix the issue .

1 Like

Did you do something in /etc/pacman.conf before this?

You don’t need to add any repo for flatpak in /etc/pacman.conf.

Adding flatpak repositories is done by using command line tool, like:

flatpak remote-add --if-not-exists [name] [location]

1 Like

Please post the contents of /etc/pacman.conf

It seems you’ve added a repo with the name flatpak (which isn’t to be done).

1 Like
#
# /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 dracut kernel-install-for-dracut eos-dracut
#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
ILoveCandy
#NoProgressBar
#CheckSpace
VerbosePkgLists
ParallelDownloads = 5

# 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.

#
# /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 dracut kernel-install-for-dracut eos-dracut
#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
ILoveCandy
#NoProgressBar
#CheckSpace
VerbosePkgLists
ParallelDownloads = 5

# 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.

[endeavouros]
SigLevel = PackageRequired
Include = /etc/pacman.d/endeavouros-mirrorlist

#[core-testing]

#Include = /etc/pacman.d/mirrorlist

[core]

Include = /etc/pacman.d/mirrorlist

#[extra-testing]

#Include = /etc/pacman.d/mirrorlist

[extra]

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
Include = /etc/pacman.d/mirrorlist

#[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

[flatpak]

Server = flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Remove this from /etc/pacman.conf.

Then in a terminal, run:

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

to add the remote flatpak repo.

See also: https://wiki.archlinux.org/title/Flatpak#

3 Likes

I’m getting "acess denied "while saving the file .

did you open the file with super user permissions? (sudo)

1 Like

In terminal: sudo nano /etc/pacman.conf

Remove that line.

Press Ctrl-O, enter, Ctrl-X to save the file and quit nano.

1 Like

Thanks, the issue was fixed. So, what actually happened? I didn’t configure the pacman.d file or add any lines like that.

1 Like

No, not in /etc/pacman.d

You must have thought that in order to install flatpak apps, you would need to add its remote repository to your /etc/pacman.conf.

Installing flatpak apps and installing packages from the official repos using pacman are two different things and done differently.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.