Skip to content

Why does pacman return 404 when the system is not fully upgraded?

When I go to install a new package using pacman -S package, all my mirrors return 404 unless I have fully upgraded the system using pacman -Syu beforehand.

I think I understand the reasoning behind this restriction, but wouldn't it be more helpful if there was an error message to the effect of "Please upgrade your system using pacman -Syu before installing new packages"? The 404 gives the impression that there might be something wrong with the user's internet connection and does not help locate the problem for someone experiencing this issue for the first time.

Apologies if this is a dumb question (it feels like one) or has been asked before—I had a look around but couldn't find anything.

1 points18 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 100% up
Kind
Text
ID
cbcq22

Author

2
posts
5
comments
0
media
View profile

20 comments

A 404 clearly indicates, that the internet connection is working fine and that the file has not been found on the server by the server. A 404 could easily be a problem with the mirror. After reading the man page and the wiki, you should not run into this problem very often, or at least not wonder why there is a 404 anymore, unless the mirror is faulty.

Read this: https://wiki.archlinux.org/index.php/Pacman#Upgrading_packages, especially the links in the red box.

8 points

Introducing such a warning message would introduce assumptions about the environment pacman is run in.

Pacman is not Arch specific (while it is developed by Arch developers and primarily used by it, it is not it's intended goal to be a package manager just for Arch) there are distributions using pacman where partial updates are normal and a safe thing to do. Arch happens to not be that distribution.

7 points

I think it gets obvious by itself - when they put new package versions in, they put old package versions out. The only way you can get 404 from a mirror is either a faulty mirror, or your local database not pointing to the correct up-to-date packages, which means it's time to update them.

6 points

but wouldn't it be more helpful if there was an error message to the effect of "Please upgrade your system using pacman -Syu before installing new packages"?

The warning is featured prominently on pacman's wiki page. There's not much handholding in Arch itself as most things can be found in the wiki.

2 points

surely the wiki is nothing more than a form of documentation. Documentation is not 'hand-holding', it's supposed to be necessary. Indicative error messages are simply another form of documentation, and are no more 'hand-holding' than the wiki. I don't believe that your reasoning stands up.

2 points

Makes sense. Thank you for this and also for clearing up other misconceptions in this thread!

1 points

It would be more helpful. As to why it doesn't, I can only guess that the developers didn't think of it or didn't think it would be worth the effort at the time. I would be surprised if they outright rejected a patch to add such a feature but I am not sure if you could convince them to do the work over the other things they are working on. You would have to ask the devs which is best done on the pacman-dev mailing list (they may or may not see it here).

You would also have to consider the other failure conditions such as your mirror becoming out of date or otherwise breaking. Creating a short but useful message can be a challenge at time but not importable to do.

2 points

This is not standard behavior, packages should still be able to be installed even if the database is not fully up to date.

Unless your last update was very old, to the point where the packages you request do not exist anymore

1 points

Unless your last update was very old, to the point where the packages you request do not exist anymore

Which can be half a day if you're unlucky, so

This is not standard behavior

rather is standard behavior.

2 points

Never ever had this behavior. It always installed packages even if my databases are not updated. If it is a standard behavior then it's not in the scope of a few days but more on a few weeks or months of not updating

1 points
unknown author

Deleted before we saved it.

1 points
unknown author

Deleted before we saved it.

1 points

It's generally a good idea to update the package database with pacman -Sy before installing any package. You (usually) don't need to do a full upgrade (-u), though.

-8 points

You (usually) don't need to do a full upgrade (-u), though.

That's even worse. OP, please don't do that. You'll just break your system eventually doing this.

7 points

Sorry, poor choice of words. What i was trying to say was: Pacman not finding packages is due to an outdated database. To update that, the -Sy flag is enough, doesn't need to be -Syu. Of course you should update your whole system regularly!

-2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.