cannot find a valid baseurl for repo:update

General support questions including new installations

cannot find a valid baseurl for repo:update

Postby delicocuk » 2006/08/27 10:29:57

when i want to

yum instal php
or yum install mysql-server

i get this error

cannot find a valid baseurl for repo:update

what's that meaning?
delicocuk
 
Posts: 1
Joined: 2006/08/27 10:26:35

Re: cannot find a valid baseurl for repo:update

Postby rpits » 2006/08/27 12:16:03

DNS is not working??
ping www.centos.org

no response then add ur DNS server to /etc/resolv.conf
rpits
 
Posts: 1
Joined: 2006/08/27 12:05:13

Re: cannot find a valid baseurl for repo:update

Postby flymagnetic_com » 2006/08/27 13:14:08

Hi,

I get this error too, but I can ping DNS entries. I've installed a vanilla Centos 4.3 on to the server. I also get no response by querying rpm. All I want to do is to manage my packages via the command line.

This is what I get:

[root@localhost ~]# yum list
Repository base is listed more than once in the configuration
Setting up repositories
not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update
[root@localhost ~]# yum update
Repository base is listed more than once in the configuration
Setting up Update Process
Setting up repositories
not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update
[root@localhost ~]# rpm -qa
[root@localhost ~]#
flymagnetic_com
 
Posts: 2
Joined: 2006/08/27 13:01:07

Re: cannot find a valid baseurl for repo:update

Postby Lenard » 2006/08/27 17:18:56

Replace your current /etc/yum.repos.d CentOS-Base.repo file with this one;

Code: Select all

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=1

[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=1

[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=0

[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=0

[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4




This should fix the problem unless you are behind a proxy server.
Lenard
 
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: cannot find a valid baseurl for repo:update

Postby flymagnetic_com » 2006/08/27 18:59:45

Thanks for this. I tried your file but got the same response. However, armed with the knowledge of this file, I did search elsewhere on this site, and noticed that your file doesn't have a baseurl. Further, I noticed that the file that came with CentOS does have these, but the lines are commented out. So I've uncommented them. This has got me further:

[font=Courier][root@localhost servit]# yum list
Repository base is listed more than once in the configuration
Setting up repositories
not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet
http://mirror.centos.org/centos/Null/updates/i386/repodata/repomd.xml: [Errno 4] IOError: HTTP Error 404: Not Found
Trying other mirror.
Cannot open/read repomd.xml file for repository: update
failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try.
Error: failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try.
[root@localhost servit]#[/font]

The Null error above seems to be causing the problem. One of the baseurl's is shown below. How do I assign the variables ($releasever, etc)?

[font=Courier]baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/[/font]
flymagnetic_com
 
Posts: 2
Joined: 2006/08/27 13:01:07

Re: cannot find a valid baseurl for repo:update

Postby Lenard » 2006/08/28 00:57:44

What versions of yum and centos-yumconf do you have installed??? Check and see if your versions match;

$ rpm -qa --qf="%{n}-%{v}-%{r}.%{arch}.rpm\n" '*yum*'
centos-yumconf-4-4.5.noarch.rpm
yum-2.4.2-2.centos4.noarch.rpm

And yes you are right I have no baseurl setup as it is not needed, please read;

http://www.centos.org/modules/news/arti ... toryid=118
Lenard
 
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: cannot find a valid baseurl for repo:update

Postby basic612 » 2006/10/02 16:51:13

flymagnetic_com wrote:

[root@localhost ~]# yum update
Repository base is listed more than once in the configuration
Setting up Update Process
Setting up repositories
not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update
[root@localhost ~]# rpm -qa
[root@localhost ~]#


Hi - the fact that rpm -qa gives no output would seem to indicate a fairly serious problem with RPM on your server. I am suffering a similar problem - although in my case I already know that I have file corruption issues due to an earlier drive failure.

My most recent backup of /var seems to have some corruption in it too. I am looking back through older backups hoping to find something I can use to recover this server.

Am I right in assuming that if I am unable to successfully rebuild the database using rpm --rebuilddb then there is not really much else for me to do other than back up all info and reinstall the server?

my output is:

[root@localhost ~]# yum check-update
Setting up repositories
not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update
[root@localhost ~]# rm -rf /var/lib/rpm
[root@localhost ~]# cp -a /backup/var/lib/rpm /var/lib/
[root@localhost ~]# rpm -qa | wc -l
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30978) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30978)
error: cannot open Packages database in /var/lib/rpm
1
[root@localhost ~]# rpm --rebuilddb
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30978) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index
[root@localhost ~]# rm -f /var/lib/rpm/__db.00*
[root@localhost ~]# rpm --rebuilddb
[root@localhost ~]# rpm -qa | wc -l
168
[root@localhost ~]# rpm -qa
[root@localhost ~]# yum check-update
Setting up repositories
not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update


Actually - I just found a backup that is a bit old but I think better than nothing!

[root@localhost ~]# rm -rf /var/lib/rpm
[root@localhost ~]# cp -a /backup/restore/var/lib/rpm /var/lib/
[root@localhost ~]# rpm -qa | wc -l
698
[root@localhost ~]# yum check-update
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 31 kB 00:00
update : ################################################## 97/97
Added 97 new packages, deleted 0 old in 1.24 seconds
....

So now all is working again... hopefully this will help someone else in this unfortunate position :-?
basic612
 
Posts: 2
Joined: 2005/10/22 16:36:35


Return to CentOS 4 - General Support

Who is online

Users browsing this forum: No registered users and 2 guests