Results 1 to 5 of 5

Thread: .bash_profile breaks graphical login for Ubuntu 22.04

  1. #1
    Join Date
    Sep 2020
    Beans
    11

    .bash_profile breaks graphical login for Ubuntu 22.04

    I'm setting up a new computer. In Ubuntu 20.04 I have a .bash_profile that calls a bash script when you open a terminal so the user can choose from a menu for what they want to do. In 22.04 when the .bash_profile is present in the users home directory they can not log in they just get a black screen with a mouse arrow. If I remove the command from the .bash_profile the user can log on just fine. The command works just fine if you open the terminal and type it. Any ideas why this is happening?
    Thanks
    Linda

  2. #2
    Join Date
    Jun 2016
    Beans
    2,833
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: .bash_profile breaks graphical login for Ubuntu 22.04

    Does it work to instead put that command at the end of .bashrc?
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  3. #3
    Join Date
    Mar 2007
    Location
    Promiseland
    Beans
    1,549
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: .bash_profile breaks graphical login for Ubuntu 22.04

    I recall trying to use .bash_profile a couple of months ago, and I had similar issues as the OP.
    What I use in all of my systems is .bash_aliases where I place my called script at the bottom of .bash_aliases.
    Code:
    # show system OS, spec summary, and words of wisdom
    ~/bin/run-id.sh
    Cheers,


    The Linux Command Line at http://linuxcommand.org/

  4. #4
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: .bash_profile breaks graphical login for Ubuntu 22.04

    First, it would be helpful if you posted your $HOME/.bash_profile contents, so we can see it and debug what is going on.

    The user-specific config file in the base of the user home folder are used to override the system wide config file in /etc

    As a rule of thumb for User-Specific Configuration files:

    • .bash_profile is called whenever a new shell is opened. )terminal session)
    • .bashrc is a configuration file for the Bash shell. The file consists of commands, functions, aliases, and scripts that execute every time a Bash session starts on Linux or macOS. The file allows customizing the shell environment with various functionalities, shortcuts, and visual tweaks.
    • .profile 'was' profile was the original profile configuration for the Bourne shell (a.k.a., sh). bash, being a Bourne compatible shell will read and use it. The .bash_profile on the other hand is 'only' read by bash. It is intended for commands that are incompatible with the standard Bourne shell.
    • .xinitrc is used to run programs depending on X and set environment variables on X server startup. Called by startx and xinit.
    • .bash_logout is sourced by bash when a bash login shell terminates. The file makes it possible to do, for example, various forms of cleanup when logging out from 'a terminal session'.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  5. #5
    Join Date
    Sep 2020
    Beans
    11

    Re: .bash_profile breaks graphical login for Ubuntu 22.04

    moving the command to .bashrc solved the problem.Thank you

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •