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.
About this post
- Posted
- Archived
- Score
- 1 · 100% up
- Kind
- Text
- ID
- cbcq22
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.
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.
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.
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.
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.
Makes sense. Thank you for this and also for clearing up other misconceptions in this thread!
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.
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
Which can be half a day if you're unlucky, so
rather is standard behavior.
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
Deleted before we saved it.
Deleted before we saved it.
It's generally a good idea to update the package database with
pacman -Sybefore installing any package. 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.
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
-Syflag is enough, doesn't need to be-Syu. Of course you should update your whole system regularly!