Hot answers tagged

339

It's not too hard. Use the following command in a terminal: sudo hostname your-new-name This will set the hostname to your-new-name until you restart. See man hostname and How do I change the computer name? for further information. Note After a restart your changes in /etc/hostname will be used, so (as you said in the question), you should still use ...


101

Ubuntu 13.04 onwards The hostnamectl command is part of the default installation on both Desktop and Server editions. It combines setting the hostname via the hostname command and editing /etc/hostname. As well as setting the static hostname, it can set the "pretty" hostname, which is not used in Ubuntu. Unfortunately, editing /etc/hosts still has to be ...


88

The command unity can be used to restart unity. It restarts the window manager, so your open programs will stay intact and you will not be logged out. If you run the command from a terminal app, you should add & disown to detach it from the terminal. If you don't, then the unity program will become a child process of the terminal app such that when you ...


56

Because apt-get is for the pros and when they do a sudo apt-get dist-upgrade and see a new kernel being installed, they know they have to reboot to activate it... The automatic update is for everyone else out there! ;-)


50

Should I restart when prompted? Yes, you should. For most cases, a restart is required when an update to the Linux kernel has been installed. These updates are usually security updates, and then only come into effect after a reboot. Updates to normal applications such as Firefox come into effect after you restart the program. Firefox should prompt you to do ...


43

Without Restart Changing the hostname or computer name in ubuntu without restart Edit /etc/hostname and change to the new value, nano /etc/hostname Edit /etc/hosts and change the old 127.0.1.1 line to your new hostname 127.0.0.1 localhost 127.0.1.1 ubuntu.local ubuntu # change to your new hostname/fqdn Note : i have read it on a forum > ...


41

The shutdown on the cog-wheel checks if you are allowed to shutdown the machine. This is done via PolicyKit. In case of shutdown this statement in the file /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy is checked: <action id="org.freedesktop.consolekit.system.stop"> <description>Stop the system</description> <message&...


34

Yes. There a couple of options. 1) You can enable CTRL+SHIFT+BACKSPACE. This three keys will work like CTRL+ALT+SUPR, but they will only restart the GUI. 2) From the command line (press CTRL+ALT+F1 to get to a console) you can restart the Ubuntu display manager (which lets a user login to her preferred GUI) by entering: sudo service lightdm restart 3) ...


26

The filesystem will usually go into read-only while the system is running if there is a filesystem consistency issue. This is specified in fstab as errors=remount-ro and will occur when a FS access fails or an emergency read-only remount is requested via Alt+SysRq+U. You can run: sudo fsck -Af -M to force a check of all filesystems. As one of the other ...


25

Ubuntu is a distribution of the GNU/Linux Operationg System which in turn belongs to the Unix system family - a common architecture for a number of modern Operating Systems. Traditionally Unix used to run on mainframe computers. Central computing facilities which serve dozends or hundreds of users via remote terminals. Since all users relied on the ...


24

The Upstart way is sudo service lightdm restart for newer versions using lightdm or sudo service gdm restart for older versions using gdm. Update: Another option, which isn't using the terminal but using a key combination, can be found at How to set keyboard combination to kill the X server?


24

Update manager suggests to restart when kernels are upgraded or some other system packages with services that are marked for reboot when upgraded. In this case /var/run/reboot-required is set by a package installation script. Command line apt-get upgrade does not suggest anything, because it is targeted to more advanced users that can decide themselves ...


23

The best way to do this will depend on why you want Ubuntu to restart every half hour. So I recommend editing your question to explain why you wish to do this. Rebooting every 30 minutes, and warning users before each reboot: Assuming people might be using the machine, either locally or remotely, it's best to avoid restarting Ubuntu from under them ...


19

Here is the command that solved my problem : mount -o remount / better than a reboot or sudo fsck -Af


19

shutdown -r now would do restart. shutdown -h now will halt/shutdown the system. In Ubuntu's case, you can use reboot or halt, etc. They all invoke the shutdown command. man reboot may help.


17

The restart button no longer shows up in that list. You need to select Shut Down. In the confirmation box, it asks you if you want Restart, Cancel or Shut Down Screenshots for better understanding


14

Good news! Apache is restarting successfully. Apache just isn't sure where you want serve from, so it's choosing your localhost by default. To prevent this message from appearing, clarify that you want to serve from localhost by adding the following line into your /etc/apache2/apache2.conf file: ServerName localhost


14

You can run this command to take down all interfaces: sudo ifdown -a Then run this to bring them back up again: sudo ifup -a Hope that helps! See also: How to restart the networking service?


14

When I reboot via the GUI I can do that without my sudo password. Only if you're the only one logged in. If there are any other users (including console users) you may have to enter a root password. This is the same on OS X and newer Windows versions. Why is that? What's happening internally of the ubuntu system there? The following command: /usr/...


13

I found this IRC log from Feb. containing a question and answer session with Peter Graner (pgraner), the Kernel Engineering Manager: <Taek> QUESTION: Is there plans or even talk about having a system update without having to restart or install third party software such as ksplice. <pgraner> Taek, the kernel will support kplice however we ...


13

When you install a new kernel you have to restart the machine in order for the changes to take effect, apt-get just doesn't nag about it.


12

Note: this answer is from the perspective of a production environment where data loss or downtime can lead to loss of money, customers, industrial equipment malfunctioning, etc. If you are just tinkering with a Raspberry Pi at home, I'd say there's no problem... :) I would not recommend Ubuntu in its default configuration, and the (default) ext4 filesystem ...


12

Because Linux is commonly used as a server or similar, and SSHing into a linux box, even a normal Ubuntu laptop, is quite common. Thing is, you may not want people with SSH access to be able to shut it down, especially when there may be other remotely logged in users using it. Someone with access to the GUI — well, he can shut it down on his own ...


11

You don't need to open a tty. In most cases Alt-F2 still works. Just enter "unity". That's it. No & disown needed.


10

The answer by hexafraction didn't work for me. Every time I tried executing sudo fsck -Af -M it just showed $ sudo fsck -Af -M fsck from util-linux 2.20.1 and nothing else. No error or anything. For me, booting into a live disc and executing this worked - sudo fsck.ext4 -f /dev/sda1 Provided the partition in question /dev/sda1 was an ext4 filesystem.


10

I love doing this by telling the Session Manager we want to reboot. This can be done without root permissions, and we get a nice window that warns us that the system is going to be rebooted -even we can cancel the reboot if we like to. The Graphical Way - Preferred Method Install gnome-schedule from the Ubuntu Software Center. If you don't want to install ...


9

Here is a script that changes the hostname in the prescribed way. It ensures that not only sudo but also X11 applications continue to function with no restart required. Usage: sudo ./change_hostname.sh new-hostname #!/usr/bin/env bash NEW_HOSTNAME=$1 echo $NEW_HOSTNAME > /proc/sys/kernel/hostname sed -i 's/127.0.1.1.*/127.0.1.1\t'"$NEW_HOSTNAME"'/g' /...


9

You can prevent service restarts with the Debian policy layer which works on Ubuntu as well. Example: Create a file named /usr/sbin/policy-rc.d with following content (don't forget to make the file executable): #!/bin/sh exit 101 No service¹ would be automatically started/stopped/restarted anymore. See /usr/share/doc/sysv-rc/README.policy-rc.d.gz ...


9

The reason you don't need to be root to initiate a shutdown from the GUI is largely a matter of convenience for the typical desktop user. The system knows that you're the user logged in on the console, so if you shut down the computer by mistake, you can presumably turn it back on. For a user in the shell, you might very well be logged in remotely, so the ...



Only top voted, non community-wiki answers of a minimum length are eligible