excluding rpms from apt-get dist-upgrade

Place to discuss Fedora and/or Red Hat

excluding rpms from apt-get dist-upgrade

Postby Captain Fdisk » Fri Jul 04, 2003 9:47 am

Hi Void and crew!

Does anyone know how to prevent apt-get dist-upgrade from upgrading certain packages? The reason being that I use cryptoapi with the modified util-linux package on Redhat 9, however the rpm is for Redhat 8 (you have to force the install).

If I do a dist-upgrade (which I do almost daily!) then apt-get quite rightly fetches the Redhat 9 util-linux and overwrites the crypto-patched version that I have.

Any help greatly appreciated!

Cheers

CF
Captain Fdisk
user
user
 
Posts: 5
Joined: Fri Jul 04, 2003 9:40 am
Location: Brighton, England

Postby Void Main » Fri Jul 04, 2003 12:52 pm

Well, I also wish there was a way to have some sort of exception list but I don't know of any way to do this via a configuration file. There is a way that I can think of to do what you want to do but it requires some faking of version numbers. Just get the *.src.rpm for the package you don't want messed with and increase the version number in the *.spec file and rebuild/reinstall the new RPM. As long as you increase the version on the RPM package to a higher version than anything else available then apt should leave it alone. I know that's kind of a Rube Goldberg way to solving the problem but it's the only way I can think of.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Tux » Fri Jul 04, 2003 3:22 pm

I'm sure there is a command for apt-get that makes it prompt you before each package installation.
I can't for the life of me remember what this may be and the apt-get help and man page didn't help. Perhaps it was a debian only thing but I am sure it exists!
I will try and look it up but it is beginning to seem a figment of my imagination... I'll look.
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Captain Fdisk » Mon Jul 07, 2003 5:00 am

Thanks guys. Things have just become a whole lot nastier too......... at some point in the last week the new XFree86 4.2.1 was put in a repository and it completely hosed my Trident 9385 / TFT setup. :shock:

So XFree86 would be another one to add to the exclusion list.

So the problem remains, all big ideas welcome!

Cheers
Captain Fdisk
user
user
 
Posts: 5
Joined: Fri Jul 04, 2003 9:40 am
Location: Brighton, England

Postby Linux Frank » Mon Jul 07, 2003 11:38 am

If you can use synaptic you can just unmark the package at the graphical list before you proceed. But I am guessing you are using Command line only, so that is unhelpful.

I am sure there is a way, in fact I think I have seen it (or something similar) as an option on the graphical interface so there must be a command line method. I think you can pass package options when you download the apt-get package list, so that they are not part of your apt-get available database. I would investigate but a recent Ximian install hosed my RPM database, so apt-get, synaptic does not work, installing RPMs does not work and all I have is red carpet, which looks really nice but does not work very well for me, and I haven't a clue how to get it back. But that is for another day still trying to perform data recovery on some corrupted CDs from a month ago.
Linux Frank
administrator
administrator
 
Posts: 239
Joined: Fri Jan 10, 2003 2:06 pm

Postby dishawjp » Fri Jul 11, 2003 6:15 pm

Hi All!

I guess that this is more of a question than an answer, but I poked through the man pages for apt-get and apt.conf and looked at the /etc/apt/apt.conf file and found the following section of that file:
RPM {
Ignore { };
Hold { };
Allow-Duplicated { "^kernel$"; "^kernel-"; "^gpg-pubkey$" };
Options { };
Install-Options "";
Erase-Options "";
Source {
Build-Command "rpmbuild --rebuild";
};
};



Could the "Ignore" or "Hold" lines in the RPM section of that file be used to do what Captain Fdisk wants to do?

Jim Dishaw
dishawjp
administrator
administrator
 
Posts: 334
Joined: Thu Jan 23, 2003 9:05 am
Location: Central NY

Postby Captain Fdisk » Tue Aug 12, 2003 3:47 am

Thanks again for your help folks, I think I have the answer in case anyone's interested:

Sorry it's taken a while to get back to you guys, it's a scorching hot summer in England and beer has taken priority over my PC for a few weeks!

I tried putting the name of the package to ignore in the "ignore" section, but any package that depends on it then throws up an error about missing packages.

The "Hold" section in apt.conf contains the answer however. For example:

Code: Select all
RPM {
        Hold { "postfix"; };
        Options { };
        Install-Options "";
        Erase-Options "";
//      Pre-Install-Pkgs { "/usr/bin/apt-sigchecker"; };
        Source { Build-Command "rpmbuild --rebuild"; };
        Allow-Duplicated {
                "^kernel$";
                "^kernel-";
                "^gpg-pubkey$";
        };
};


This holds back postfix from being upgraded during a dist-upgrade (but obviously any package which depends on it will be held back too).

And this little beauty:

Code: Select all
rm -f /var/cache/apt/*.bin
apt-get update


....actually removes the apt cache files so that the above Hold or Ignore options work. If you fail to clear the cache then your changes to apt.conf don't appear to take effect.

Problem sorted!!! Now I'm off to sit under an air-conditioner and get a cold beer...... :twisted:

Cheers
CF
Captain Fdisk
user
user
 
Posts: 5
Joined: Fri Jul 04, 2003 9:40 am
Location: Brighton, England


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 0 guests

cron