You are not logged in.

#1 2016-02-08 18:23:58

madmaurice
Member
Registered: 2010-04-18
Posts: 22

mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Heya people,

i've ran into weird behavior with the pacman-mirrorlist package this evening. instead of providing any new mirrorlist.pacnew, upgrading said package removes mirrorlist.pacnew and empties mirrorlist.

No problem thanks to the mirrorlist generator, but just because I was curious i tried it again and the same thing happened. mirrorlist.pacnew removed and mirrorlist empty.

It happened once in the past and today again and i am wondering if someone else has the same weird problem as i haven't found another forum post yet that describes this exact problem?

PS.: i checked the pkg.tar.gz in /var/cache/pacman and it does indeed contain a valid mirrorlist. so it's not a faulty download or something

Last edited by madmaurice (2016-02-08 18:26:10)

Offline

#2 2016-02-08 19:01:34

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Try installing the package again with --debug and post the output.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2016-02-08 19:10:30

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

I do not know how pacman would be emptying your mirrorlist, but removing the .pacnew file is a known bug: https://bugs.archlinux.org/task/47993

Offline

#4 2016-02-09 04:17:47

madmaurice
Member
Registered: 2010-04-18
Posts: 22

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Offline

#5 2016-02-09 14:01:23

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

I had the same problem, yesterday (no pacnew file after mirrorlist package update installation). Since my working mirrorlist file still exists, I ignored it, but if this continues, future updates will not be obtainable (if they are installed but immediately deleted by pacman).

Tim

Offline

#6 2016-02-09 14:10:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,561

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Not creating a pacnew file is normal when the file doesn't change between packages.

Offline

#7 2016-02-09 14:13:06

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Scimmia wrote:

when the file doesn't change between packages.

That would only be true if the extant mirrorlist had no un-commented lines (and would thus be non-functional), surely?

EDIT: FWIW I have updated two machines recently and the mirorlist.pacnew files were created as usual.

Last edited by Head_on_a_Stick (2016-02-09 14:14:26)

Offline

#8 2016-02-09 14:15:08

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,561

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

That's not what I mean. 20160208-1 and 20160208-2 contain exactly the same mirrorlist, so updating from the first to the second will not create a pacnew file.

Last edited by Scimmia (2016-02-09 14:15:16)

Offline

#9 2016-02-10 11:53:37

madmaurice
Member
Registered: 2010-04-18
Posts: 22

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Scimmia wrote:

That's not what I mean. 20160208-1 and 20160208-2 contain exactly the same mirrorlist, so updating from the first to the second will not create a pacnew file.

That's desired if I don't change said file, but as we're talking about the mirrorlist in which We usually uncomment mirrors to use on every update, the file has indeed changed and it should create a pacnew file wether or not the original mirrorlist didn't change or not as my "configuration" differs from the new "configuration"

And it should certainly not delete any previous pacnew file or empty the mirrorlist.

Edit:
As far I as I learned it from using pacman until now. the idea of a pacnew file was to be created on an update if my configuration differs from the previous original. Not if the new original differs from the previous original.

P.S.: Why the hell was there a second mirrorlist update when the content of mirrorlist didn't change anyway?

Last edited by madmaurice (2016-02-10 12:05:08)

Offline

#10 2016-02-10 12:46:13

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

pacman has never created a pacnew file when the file did not change between package versions whether it was modified on the system or not.

Offline

#11 2016-02-10 13:04:19

madmaurice
Member
Registered: 2010-04-18
Posts: 22

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

apg wrote:

pacman has never created a pacnew file when the file did not change between package versions whether it was modified on the system or not.

I guess I never stop learning. yet it still shouldn't delete any present pacnew file in that case and if it should i guess i have to maintain a second backup of the mirrorlist.

Offline

#12 2016-02-10 15:04:15

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Scimmia wrote:

That's not what I mean. 20160208-1 and 20160208-2 contain exactly the same mirrorlist, so updating from the first to the second will not create a pacnew file.

Which makes me wonder why there are two versions if they are exactly the same?

But, ok then.

Tim

Offline

#13 2016-02-10 15:13:40

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,561

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

It had more to do with the method of building the package than the payload of the package itself. People are working towards reproducible builds on Arch, which requires all packages be built in a clean chroot. Occasionally, shortcuts were taken.

Offline

#14 2016-02-10 21:40:19

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,395
Website

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

madmaurice wrote:
apg wrote:

pacman has never created a pacnew file when the file did not change between package versions whether it was modified on the system or not.

I guess I never stop learning. yet it still shouldn't delete any present pacnew file in that case and if it should i guess i have to maintain a second backup of the mirrorlist.

This is a known bug and has a fix for the next release (coming soon TM)

Offline

#15 2016-02-12 08:38:23

madmaurice
Member
Registered: 2010-04-18
Posts: 22

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Allan wrote:
madmaurice wrote:
apg wrote:

pacman has never created a pacnew file when the file did not change between package versions whether it was modified on the system or not.

I guess I never stop learning. yet it still shouldn't delete any present pacnew file in that case and if it should i guess i have to maintain a second backup of the mirrorlist.

This is a known bug and has a fix for the next release (coming soon TM)

Thanks Allan, I know, apg already referred me to the bug report earlier in the thread, and I'm eagerly awaiting a fix for that.

About the empty mirrorlist itself, that might have been my fault.
I've wrote a script which I run after a mirrorlist upgrade that collects mirrors of a desired country from the pacnew file and saves it into the mirrorlist.
I found out that said script doesn't check for the existance of the pacnew file. My bad.

If nobody wants to add more to the conversation/argument I'd close this thread as people are already taking care of the pacnew problem.

Edit: Apparently i can't close a thread on this board.

- mad.

Last edited by madmaurice (2016-02-13 05:06:14)

Offline

#16 2016-02-13 09:02:32

severach
Member
Registered: 2015-05-23
Posts: 192

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

I also wrote a script for the mirror list. It does 3 things.

* Comment out all mirrors.
* Uncomment the mirror I want.
* Add my local nginx proxy in at the top.

I'm hoping the newfangled hooks will allow me to run this script automatically.

If I were the package maintainer it would be easy. But I'm not.

Last edited by severach (2016-02-13 09:03:24)

Offline

#17 2016-02-13 23:32:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

I'm not sure I follow. If you have your own mirrorlist, a mirrorlist.pacnew is going to be created. You can create an alias to remove mirrorlist.pacnew:

$ type rmir
rmir is aliased to `sudo rm -f /etc/pacman.d/mirrorlist.pacnew'

Offline

#18 2016-02-13 23:38:32

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,561

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Or simply add the mirrorlist to NoExtract in pacman.conf

Offline

#19 2016-02-14 04:37:17

severach
Member
Registered: 2015-05-23
Posts: 192

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

I forgot the step where I overwrite the old mirrorlist with the .pacnew. I got tired of hand editing the mirrorlist.pacnew each time so I wrote this.

#!/bin/sh

if [ -s 'mirrorlist.pacnew' ]; then
  echo 'Server = http://192.168.50.10:8080/archlinux/$repo/os/$arch' > 'mirrorlist'
  sed -e 's:^Server:#&:g' \
       -e 's|^#\(Server = http://mirrors\.favorite1\.com/.*\)$|\1|g' \
       -e '#s|^#\(Server = http://mirrors\.favorite2\.com/.*\)$|\1|g' \
  '/etc/pacman.d/mirrorlist.pacnew' >> 'mirrorlist'
  rm 'mirrorlist.pacnew'
fi

I tap this every time a mirrorlist.pacnew comes down and I get all the updates with my settings applied.

Offline

#20 2016-02-15 08:23:21

madmaurice
Member
Registered: 2010-04-18
Posts: 22

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

karol wrote:

I'm not sure I follow. If you have your own mirrorlist, a mirrorlist.pacnew is going to be created. You can create an alias to remove mirrorlist.pacnew:

$ type rmir
rmir is aliased to `sudo rm -f /etc/pacman.d/mirrorlist.pacnew'

No. My problem isn't that there is a pacnew file. my problem is that pacman deletes any pacnew file on update if the contents haven't changed from a previous version.

@severach
here is my script:

#!/bin/bash

if [ $# -ne 1 ]; then
    echo "$0 <Country>"
    exit 1
fi

country=$1

INPUT=/etc/pacman.d/mirrorlist.pacnew
OUTPUT=/etc/pacman.d/mirrorlist

if [ ! -f "$INPUT" ]; then
    echo "$INPUT is missing."
    exit 1
fi

cat $INPUT | awk -v "COUNTRY=$country" 'BEGIN { c="" } /^##/ { c=substr($0,4); } /^#Server/ { if(c==COUNTRY) { print substr($0,2); } }' | rankmirrors - | sudo tee $OUTPUT

it selects all mirrors in the pacnew from a country you gave as an argument, runs it through rankmirrors and then saves it as mirrorlist.
(Edit: I added the 2nd if clause the other day to prevent creating an empty mirrorlist if the pacnew file doesn't exist)

Last edited by madmaurice (2016-02-15 08:25:26)

Offline

#21 2016-02-15 08:38:26

Ziusudra
Member
Registered: 2014-04-19
Posts: 120

Re: mirrorlist.pacnew gone after upgrade of pacman-mirrorlist

Please edit the first post of this thread and add [SOLVED] to the subject/title.

It is solved, right? Even if the bug gets fixed the script is better with the check.

Edit: by "the bug" I mean pacman deleting the pacnew

Last edited by Ziusudra (2016-02-15 08:44:37)

Offline

Board footer

Powered by FluxBB