Ubuntu 16.04 LTS权限问题及命令使用故障求助
Hey there, let's break down your Ubuntu 16.04 LTS issues one by one and get them sorted out:
Is this behavior normal?
Let's walk through each of your observations to clarify what's expected and what's not:
- .conf files owned by root: This is completely normal for system-level configuration files. Most core services (like web servers, network tools) store their configs in
/etc/or subdirectories, and root ownership prevents accidental modifications by regular users that could break critical system functionality. - Can't open .conf files in GUI: This is expected too—your GUI runs under your regular user account, which doesn't have write (and sometimes even read) access to root-protected system files. You can open them with GUI editors using elevated privileges, e.g., run
gksudo gedit /path/to/your/file.conf(if gksudo is installed) or use a terminal-based editor with sudo instead. - Most files owned by root, admin can't access: This isn't normal if you're referring to your personal user files. System directories (like
/bin,/etc,/root) should be root-owned, but your home directory (/home/your-username) and its contents should belong to your user account. If even sudo-level actions are blocked, that's a red flag we'll address with the lighttpd installation issue.
Fixing the "no root permission" error when installing lighttpd with sudo
If sudo apt install lighttpd is throwing permission errors, follow these troubleshooting steps:
- Verify your user has sudo privileges:
Rungroupsin the terminal—you should seesudoin the list of groups associated with your account. If not, you'll need to add your user to the sudo group (this requires root access; if you can't get root, boot into recovery mode first). Use this command:usermod -aG sudo your-username - Fix corrupted package cache or permissions:
Sometimes the apt cache or system directories have messed up permissions. Run these commands in order to reset things:sudo chown -R root:root /var/lib/apt/lists/ sudo apt clean sudo apt update - Re-attempt the lighttpd installation:
After fixing the cache, run the installation command again:sudo apt install lighttpd -y - Check for filesystem corruption:
If the above steps fail, there might be underlying filesystem issues. Reboot into recovery mode, select "fsck" from the menu, and follow prompts to repair any detected errors.
Bonus: Accessing .conf files easily
Instead of fighting GUI permissions, use terminal-based editors with sudo for editing system config files:
sudo nano /etc/lighttpd/lighttpd.conf: Nano is beginner-friendly with simple on-screen controls.sudo vim /etc/lighttpd/lighttpd.conf: Vim is more powerful but has a steeper learning curve.
内容的提问来源于stack exchange,提问作者uglybug
相关产品推荐
相关产品推荐

