LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-12-2022, 03:18 AM   #1
kingcoil
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Rep: Reputation: 0
home folder vs. home/user folder


Hi all,
In my Ubuntu 21.04 install, my HOME folder contains my user-installed apps, etc. In my Ubuntu 22.10 install, the HOME folder contains a <USERNAME> folder that contains user-installed apps. For the sake of uniformity I want to move all items out of my <USERNAME> folder in 22.10 and up a level into the HOME folder. Is it safe to do so without trashing my user-installed apps? If so, are there any special considerations I should be aware of? Thanks!

kingcoil
 
Old 10-12-2022, 03:49 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,013

Rep: Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340
It is in general safe, but probably there are config files which will look for your tools in their old locations. In that case you need to adjust all the references and related settings (like your .bashrc).
 
1 members found this post helpful.
Old 10-12-2022, 04:02 AM   #3
kingcoil
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the fast response, pan64. There are numerous folders in my .config folder and I have no desire to re-install my user apps. I have no idea which files would need to be changed to a different home folder location. Also, it seems APT and DPKG install new apps into the <USER> folder so I would have to change that behavior each time I install a new app. It appears to me that moving the apps may be a recipe for tragedy lol.
 
Old 10-12-2022, 04:05 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,013

Rep: Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340
You always try to move one, and move back in case of a problem (or fix that).
 
Old 10-12-2022, 04:10 AM   #5
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,510

Rep: Reputation: Disabled
Should work basically, but you will likely need to alter the path names, to where you now have put them.
 
Old 10-12-2022, 04:14 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
One day you will need to create a new user to test/correct something. If you have made all the necessary changes, you are really going to regret scratching this particular itch.
 
1 members found this post helpful.
Old 10-12-2022, 09:29 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Quote:
Originally Posted by syg00 View Post
[...] you are really going to regret scratching this particular itch.
I agree. Some things "just are what they are," and I advise you to leave them alone even if you think they smell funny.
 
Old 10-12-2022, 09:38 AM   #8
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
I do not use Ubuntu, but usually all apps are installed systemwide, why are dpkg and apt installing into /home/<user> ? Just curious.
 
Old 10-12-2022, 10:06 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,013

Rep: Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340
Quote:
Originally Posted by Emerson View Post
I do not use Ubuntu, but usually all apps are installed systemwide, why are dpkg and apt installing into /home/<user> ? Just curious.
no, I don't think so. It was something else, not apt and/or dpkg. But OP will tell us exactly how it was made.
 
1 members found this post helpful.
Old 10-12-2022, 10:44 AM   #10
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
Quote:
Originally Posted by kingcoil View Post
Thanks for the fast response, pan64. There are numerous folders in my .config folder and I have no desire to re-install my user apps. I have no idea which files would need to be changed to a different home folder location. Also, it seems APT and DPKG install new apps into the <USER> folder so I would have to change that behavior each time I install a new app. It appears to me that moving the apps may be a recipe for tragedy lol.
I see here DPKG and APT mentioned, loud an clear.
 
Old 10-12-2022, 01:20 PM   #11
kingcoil
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson View Post
I do not use Ubuntu, but usually all apps are installed systemwide, why are dpkg and apt installing into /home/<user> ? Just curious.
What I meant to say was that some packages install folders in the <home/user> folder. Apt apps and dpkgs are indeed installed systemwide. It would be pretty much impossible to determine where all my apps install their data. So, I'm gonna let sleeping dogs lie and leave it all as is. Thanks to all who responded!

kingcoil
 
Old 10-12-2022, 02:10 PM   #12
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
Quote:
It would be pretty much impossible to determine where all my apps install their data.
What kind of data is this? There is filesystem hierarchy standard, it determines where the binaries go and everything else. System-wide configuration files go to /etc/*, in case user has their own config it goes to ~/.config/*. Databases go to /var/*, so on. See 'man hier'. You will find a Linux system is well organized and everything has its place.
 
Old 10-12-2022, 08:50 PM   #13
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by Emerson View Post
You will find a Linux system is well organized and everything has its place.
Yep, and historically, from the beginning, each users home directory has been located at /home/user. Attempting to change that would quickly become a nightmare to manage. The OP said he will let sleeping dogs lie, which is probably a good thing.
 
Old 10-13-2022, 09:03 AM   #14
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,619

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555

A benefit of moving a user's home directory to /home is less typing, but there are ways to reduce typing without incurring the disadvantages of putting files in /home.

When in a command-line shell, one can usually use "$HOME/whatever" instead of "/home/username/whatever".

There's an even shorter shortcut that also works outside a shell, which is "~/whatever"

The ~ character is called "tilde", and is in different positions depending on keyboard layouts - US QWERTY has it to the left of 1 (below Esc), as shift-`, whilst UK QWERTY has it next to Enter, as shift-#, (and other layouts may have it in other places).

If the keyboard doesn't have it, or pressing shift is annoying, one could potentially symlink /me -> /home/username and use "/me/whatever" instead.



Also, a slight aside going in the other direction, "/home/username" is only the default - the FHS does not require this, and with a large userbase one might want to use, for example, "/home/department/username" or similar. (Also, other Unix-based systems may use other locations.)

Doing so might break badly written scripts (if they use "/home/$USER" instead of "$HOME"), but it is a permitted choice:
Quote:
Originally Posted by man hier
/home
On machines with home directories for users, these are usually beneath this directory, directly or not. The structure of this directory depends on local administration decisions (optional).
Quote:
Originally Posted by FHS v3
[6] Different people prefer to place user accounts in a variety of places. This section describes only a suggested placement for user home directories; nevertheless we recommend that all FHS-compliant distributions use this as the default location for user home directories. Non-login accounts created for administrative purposes often have their home directories elsewhere.

On smaller systems, each user's home directory is typically implemented as a subdirectory directly under /home, for example /home/smith, /home/torvalds, /home/operator, etc. On large systems (especially when the /home directories are shared amongst many hosts using NFS) it is useful to subdivide user home directories. Subdivision may be accomplished by using subdirectories such as /home/staff, /home/guests, /home/students, etc.
 
Old 10-13-2022, 09:05 AM   #15
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,619

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
Quote:
Originally Posted by Emerson View Post
You will find a Linux system is well organized and everything has its place.
It is definitely organized, but whether it's well organized is debatable.

(If I were doing it, I probably wouldn't have a dozen different directories under which a particular executable might be found.)

 
  


Reply

Tags
filesystems, folders structure



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Store ecryptfs files inside home folder when enabling full home folder encryption in Linux Murz Linux - Security 4 10-27-2018 03:57 AM
extracting root folder to a user home folder command mzein1292 Linux - Newbie 3 06-23-2015 07:26 AM
Desktop displays '/home/*user*' instead of '/home/*user*/desktop' campbell226 Linux - Desktop 2 08-05-2008 06:15 AM
Home folder icon does not open home folder CiscoGeek Linux - Newbie 3 12-18-2006 07:00 AM
I can not open the user folder in home and write in a shared folder jorge_ivan Linux - General 8 08-02-2006 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration