[SOLVED] How to move all user installed packages to my home partition?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to move all user installed packages to my home partition?
I was installing some packages and I ended up using up 100% of the hard drive space in my root partition. I'd like to move any and all non-default packages I've installed into my home partition. Is this doable? As well as making it so any future packages I install will install there as well?
My partition scheme is as follows:
/dev/sda1 -boot
/dev/sda2 -swap
/dev/sda3 -extended
/dev/sda5 -root - within sda3
/dev/sda6 -home - within sda3
Programs generally can't be moved because they have the pathnames of auxiliary files compiled into them.
You can either make a bigger root partition or recompile the programs to use a different path. ~/.local is a good choice for programs used only by you.
Ed
You need to create copy of directory structure - so you need $HOME/usr, $HOME/usr/bin etc. And put $HOME/usr/bin, $HOME/usr/sbin in your $PATH. Just look at /usr/local - you should have exactly the same directory structure in your $HOME as /usr/local.
Code:
piotr[~]$ ls /usr/local/
bin etc games include info lib man sbin share src
Edit: I forgot, here from installpkg manual
Code:
--root /otherroot
Install using a location other than / (the default) as the root
of the filesystem to install on. In the example given, use
/otherroot instead. Setting the ROOT environment variable does
the same thing.
It is as SBo packages are created - after compilation they are installed in some place - on my computer it is /tmp/SBo - then archived. If you share computer with others it is good idea to require personal binaries go under $HOME - just don't mess with system.
Installed packages are installed based on the file structure within the package. As Ed mentioned, installing them to another place may cause breakage without recompiling the package. As igadoter shows, there is an option for installpkg for you to specify installing to a different location, but if the packages rely on absolute locations, it'll likely lead to broken packages. You'd need to compile the packages to be installed in other directions, and SBo doesn't make it an easy to change option. You'd need to manually modify each and every SlackBuild to install to that new location.
If you just want to save the resulting packages (which are typically stored in /tmp/, they can easily be moved to wherever is best for you.
You'd need to compile the packages to be installed in other directions, and SBo doesn't make it an easy to change option. You'd need to manually modify each and every SlackBuild to install to that new location.
All SBo packages I built were installed at first under /tmp/SBo. So it is pure clean they cannot rely on fixed location in system. If that would be case the only way to run them is to keep them all constantly under /tmp/SBo - this is installation directory being set during compilation. Maybe there applications which looks up for full path - but I don't think these are SBo packages. It is easy just pick up any SBo package at hand and install it with installpkg under /usr/locale. Will see does it work or not. It is just advised to install under /usr. Essentially as for me good idea is separate partition under /usr/locale - the place where additional software, packages go. Just one look under /usr/local and one sees what is out of Slackware. System cleanup now means clean /usr/local. It is also convenient in case someone don't want to go with packaging. Just ./configure ; make ; sudo make install. Usually config script contains /usr/local as installation directory as default.
Distribution: Slackware 64 -current multilib from AlienBob's LiveSlak MATE
Posts: 1,074
Rep:
If I understand your situation correctly you're running out of space in /dev/sda1 but have plenty of space left in /dev/sda3. In that case, the simplest solution would be to shrink /dev/sda3, move /dev sda2, and then increase the size of /dev/sda1 accordingly. GParted will do that for you. You will get a warning that resizing the boot partition may break your install, but in practice it should work out fine, I've done this more than once without any issues.
you can use such descritpion to effectively move all files to another location say
Code:
$ while read file ; do cp -a /"$file" $HOME ; done < my-compton-i586-1_SBo
if things are ok - I mean application runs - you can now delete files from original location. But first you need to filter log file to remove some parts eg. lines which ends with /, say
All SBo packages I built were installed at first under /tmp/SBo. So it is pure clean they cannot rely on fixed location in system. If that would be case the only way to run them is to keep them all constantly under /tmp/SBo - this is installation directory being set during compilation. Maybe there applications which looks up for full path - but I don't think these are SBo packages. It is easy just pick up any SBo package at hand and install it with installpkg under /usr/locale. Will see does it work or not. It is just advised to install under /usr. Essentially as for me good idea is separate partition under /usr/locale - the place where additional software, packages go. Just one look under /usr/local and one sees what is out of Slackware. System cleanup now means clean /usr/local. It is also convenient in case someone don't want to go with packaging. Just ./configure ; make ; sudo make install. Usually config script contains /usr/local as installation directory as default.
The programs aren't designed to run out of /tmp/SBo. That is strictly the staging directory for packaging (if you look at SlackBuilds, they use something similar to this for compilation:
The --prefix option tells ./configure where the program is intended to be installed to. This is an absolute location. If you wanted it installed in /usr/local/ or ~/programs, you'd need to adjust the --prefix option to do that. The /usr prefix is hardcoded into the SlackBuild, so if you want to change it, you have to manually edit the SlackBuild to do so (vs passing an updated VERSION variable if you want to do a version bump).
What allows the programs to be staged in a separate directory is the following line, which installs the program after the compilation has completed:
Code:
make install DESTDIR=$PKG
This will run the install, but will add the $PKG variable before all the install locations. This allows things to be installed in a separate, standalone directory that allows for easy packaging. While some programs might run in the /tmp/SBo folder, many won't. For example, if we look at picard, if you try to run it from /tmp/SBo/package-picard without it being installed, you'll get the following error, because it's looking for the picard python module in a hardcoded location:
Code:
jbhansen@craven-moorhead:/tmp/SBo$ package-picard/usr/bin/picard
Traceback (most recent call last):
File "package-picard/usr/bin/picard", line 2, in <module>
from picard.tagger import main; main('/usr/share/locale', True)
ModuleNotFoundError: No module named 'picard'
Just going to point out that the "--root" option to installpkg is for setting up a chroot. If you want to use it for anything else, well, you're going to have to be the first to try it.
Oh, and the syntax is "installpkg --root PATH", not "installpkg --root=PATH". I've hosed my system with this mistake
I hate threads where OP lobs a question out there and then vanishes. Guess they got the answers they needed but would be nice for them to thank the folks that helped them, or at least provide some sort of response.
Thread is marked as solved. But for me is ok. I learned quite a lot. Say now I am convinced to create my own packages. With my own flavour but essentially follwing sbo.
Creating packages is easy but I did not understand why OP wanted to install them to their /home directory. That made no sense to me. To each, his/her own though
I understand. But you can still omit limitations with symbolic links. Point it to needed library which can be kept anywhere.
That could require a large amount of symbolic links depending on the package. Could you imagine trying to symlink everything needed to properly run qt5? There would be some directories you could symlink, but all these libs in /usr/lib{,64} would need to be manually symlinked. You might be able to prevent needing to symlink these by using LD_PRELOAD. But I certainly wouldn't want to take the time and try and fix all the issues that would crop up from installing a package designed to be in /usr/ to some random directory on the system. It would be much easier to just rebuild the program setting a new prefix or resizing my partitions (if possible) to provide me more space in the partition containing /usr/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.