Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Removing a package without actually removing any files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
flatmodel
n00b
n00b


Joined: 01 Mar 2013
Posts: 26
Location: UK

PostPosted: Wed May 25, 2022 2:01 pm    Post subject: Removing a package without actually removing any files Reply with quote

For various reasons, I need to keep an old version of Perl installed. To achieve this, I have masked off any and all Perl versions that would otherwise update the Perl installation that I already have. This works fine as far as it goes, but it's causing me problems when I try to do an
Code:
emerge -a -uD @ world
Ideally, I would like to do an
Code:
emerge -C perl
to remove Perl from the package database but without deleting any files on the filesystem. Is there a way of removing a package from the database without removing any of the underlying files?
_________________
Richard
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Wed May 25, 2022 2:12 pm    Post subject: Reply with quote

The default location for the system fingerprint is at /var/db/pkg, but removing all traces there is at least against good practice. I've never had to resort to that, and I'm reckless.

IIRC, perl can have multiple versions installed simultaneously. If you want to protect a given version, add that to world and make a local ebuild. You will likely run into issues in the long run as portage advances - this happens to me trying stay on kernel 4.19.114, and a couple other deprecated packages that just work, while newer versions just don't.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Wed May 25, 2022 3:09 pm    Post subject: Reply with quote

Perl is not slotted, so you cannot have multiple versions co-installed. Python is slotted, though.

I think the best course of action would be to update Perl. The second best course would be to keep it installed and masked, so that Portage can at least warn about the problems this causes. If OP were to successfully orphan Perl, then Portage would start trying to install a modern Perl over it as soon as anything needed Perl. That would just make the situation worse.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2963
Location: Edge of marsh USA

PostPosted: Thu May 26, 2022 4:08 am    Post subject: Reply with quote

Why do you need to keep an old version of perl? Doing what you want creates a dead end that will result in a broken system. What is the problem that causes this issue for you? Whatever the problem is, there is likely some other solution.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Thu May 26, 2022 1:27 pm    Post subject: Reply with quote

I know of a way that would probably achieve the OP's goal of not updating Perl and also suppressing Portage's attempts to update Perl. However, it is a horrible hack, and I agree with figueroa. The proposed plan is almost certain to cause more problems than it solves.

I strongly discourage doing as OP describes. However, OP: if you want to go down this path, change the installed Perl to have a different slot, so that you can install a newer slot 0 perl. Create an overlay that offers a sufficiently high versioned perl ebuild that installs no files, and is in slot 0. This will satisfy Portage, without uninstalling or orphaning any files. I fully expect you will get weird breakage the next time something asks for a modern Perl, wrongly believes you have it due to the empty perl ebuild, and then uses modern Perl features in your outdated Perl install.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3345
Location: Rasi, Finland

PostPosted: Thu May 26, 2022 1:46 pm    Post subject: Reply with quote

If I'd need an older version of Perl then I'd probably copy the ebuild to a local overlay and modify it so that it would get installed in some other location (kinda slotting it), thus avoiding file collisions. Then when running a program that needs this older perl version I'd need to modify the PATH in the current env.

This way other (perl) things would continue to work in my system while still having the old perl installed.

But since perl isn't slotted by default, there must be reason for it? I could be tricky to slot perl. I'm no perl expert by any means, so I'm just guessing here.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
flatmodel
n00b
n00b


Joined: 01 Mar 2013
Posts: 26
Location: UK

PostPosted: Thu May 26, 2022 3:34 pm    Post subject: Reply with quote

figueroa wrote:
Why do you need to keep an old version of perl?


I have a server running logitech's Squeezebox server (logitechmediaserver-bin), the daemon is written entirely in perl. This application comes from the "Squeezebox" overlay tree. For reasons I don't entirely understand, this won't run under perl 5.34, the currently favoured version. Under 5.32, everything is fine. There doesn't appear to be anything else on the system that needs perl in order to function, so it's just this one application that (at present) needs the old version of perl. Eventually, there will no doubt be a version of the squeezebox application that will run under perl 5.34 released eventually, but such is the state of play at present. Although I'm a competent perl programmer (a bit rusty though), as anyone will tell you it's a bitch to try and maintain someone else's code written in perl, unless you're in precisely the same head-space of the original author. I could attempt to modify the application to make it work under the newer perl version, but this would be an arduous task. Since perl isn't required for anything else, keeping the old version seems to be the path of least resistance; but it's a pain when trying to keep the rest of the system up-to-date. I have been blundering along by manually updating other packages by hand; but this is uphill work.

I'm probably favouring at least trying the edit of /var/db/pkg route, and resorting to the backup if things go horribly wrong, in the absence of any better solution.
_________________
Richard
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Thu May 26, 2022 3:48 pm    Post subject: Reply with quote

If it is really the case that nothing else needs a newer Perl, then using /etc/portage/package.mask to tell Portage not to upgrade Perl should suffice. No need to play any elaborate tricks. This will generate a diagnostic the first time an ebuild you want has a declared dependency on a newer Perl, at which point you can reevaluate whether to keep an old Perl (and forgo that ebuild), give up the daemon, or fix the daemon.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2963
Location: Edge of marsh USA

PostPosted: Thu May 26, 2022 3:58 pm    Post subject: Reply with quote

Why not try to mask >=dev-lang/perl-5.33.0
If nothing really needs a higher version, portage should be satisfied.

Are you committed to running Squeezebox server under Gentoo. Could you run it under a Debian stable distribution and run it in a virtual machine? The current version of MX-Linux which is 21, is running perl 5.32.1-4+deb11u2, and will have LTS support through 2026.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
antonellocaroli
Guru
Guru


Joined: 11 Aug 2016
Posts: 510

PostPosted: Thu May 26, 2022 4:40 pm    Post subject: Reply with quote

If it is only for logtechmediaserver there is no need to maintain an old version of perl...

I'm not an ebuild expert (some expert will probably find some errors) but I run this on a local overlay and it works...


https://github.com/antonellocaroli/GP-overlay/blob/master/media-sound/logitechmediaserver-bin/logitechmediaserver-bin-8.3.0_pre20220507.ebuild

you should change something... like sox-dsd in sox...

basically delete the perl included in LMS and create a link to the perl installed on the system....

update HASHID and BUILDID
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Thu May 26, 2022 10:08 pm    Post subject: Reply with quote

Don't edit anything in /var/db/pkg!

I was just remarking as an academic point, one could erase all traces of a package from there. In hindsight, portage would figure out the package was gone and try to reinstall it.

I've kept a few deprecated package versions by masking newer and keeping an ebuild for an older version in local overlay. That would be my first resort in your spot.
Back to top
View user's profile Send private message
flatmodel
n00b
n00b


Joined: 01 Mar 2013
Posts: 26
Location: UK

PostPosted: Fri May 27, 2022 12:37 pm    Post subject: Reply with quote

[quote="cboldt"]Don't edit anything in /var/db/pkg!

Don't worry, I haven't gone down that route! :lol:

I've removed anything that might refer to perl, with the exception of the interpreter itself, and I get this...

Code:
newton3 ~ # emerge -a -uD @world

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy "=dev-lang/perl-5.34*" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-lang/perl-5.34.1-r3::gentoo (masked by: package.mask, ~amd64 keyword)
/etc/portage/package.mask:
# package.mask
# #

- dev-lang/perl-5.34.1-r2::gentoo (masked by: package.mask, ~amd64 keyword)
- dev-lang/perl-5.34.0-r11::gentoo (masked by: package.mask, ~amd64 keyword)
- dev-lang/perl-5.34.0-r10::gentoo (masked by: package.mask, ~amd64 keyword)
- dev-lang/perl-5.34.0-r9::gentoo (masked by: package.mask)

(dependency required by "virtual/perl-File-Spec-3.800.0::gentoo" [ebuild])
(dependency required by "dev-perl/Pod-Parser-1.630.0-r1::gentoo" [ebuild])
(dependency required by "app-text/po4a-0.64::gentoo" [ebuild])
(dependency required by "sys-apps/man-db-2.10.2-r1::gentoo[nls]" [ebuild])
(dependency required by "virtual/man-0-r4::gentoo" [ebuild])
(dependency required by "@system" [set])
(dependency required by "@world" [argument])
For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.


I'm really at a loss over what to do about this.
_________________
Richard
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Fri May 27, 2022 2:15 pm    Post subject: Reply with quote

All the versions of perl in the gentoo repository are 5.34. Portage has no alternative unless you give it one.

If you still have perl-5.32 installed, a copy of the ebuild for that is in /var/db/pkg/dev-lang/perl-*

Do you have a local repository? I keep one at /var/db/repos/local for a handful of programs deprecated by Gentoo, but in use on my systems. Put a copy of the perl-5.32.x.ebuild in /var/db/repos/local/dev-lang/perl -- you'll also have to call on `ebuild` to create a Manifest file in /var/db/repos/local/dev-lang/perl and there is probably a need for some patch files. You'd have to hunt around to find those.

You also have to tell portage you have a local repository. That's done in /etc/portage/repos.conf. More than one correct way to do that, I use one file to list all the repos(itories).

That in combination with your masking of versions 5.34 is how to stall your system at a deprecated version. As noted before, there will be issues of various types in the long run. I've ebuilds fail due to deprecated EAPI (I just change the ebuild to refer to a newer EAPI), deprecated *.eclass (I put the derecated eclass file into the local repository), and dependency failures.

Edited to add: the dependency failures that you note probably exist because some other package depends on them. Pretend to remove each and you'll see where the dependency lies. For example ...

Code:
emerge --depclean --pretend --verbose Pod-Parser


The idea being that you'd like to remove all the dependencies. At some point an app depends on perl. Then you have to either get rid of the app, or turn off the app dependency on perl (USE=-perl), or find a way to supply perl.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum