Difference between revisions of "Ubuntu"

From wiki
Jump to navigation Jump to search
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Category:Linux/Unix]]
 
[https://www.ubuntu.com/ Ubuntu] is a linux distribution derived from [https://www.debian.org/ debian]. It's a very nice plug&play OS with all features I need.
 
[https://www.ubuntu.com/ Ubuntu] is a linux distribution derived from [https://www.debian.org/ debian]. It's a very nice plug&play OS with all features I need.
  
Line 12: Line 13:
 
===NetworkManager===
 
===NetworkManager===
  
NetworkManager is a bad idea, just disable it and use <code>/etc/network/[[Networking#Interfaces|interfaces]]</code> to configure your network. You may need to install ifupdown and disable the netplan thing to achieve this.
+
NetworkManager is a bad idea, just use <code>/etc/network/[[Networking#Interfaces|interfaces]]</code> and /etc/resolv.conf to configure your network. Having a DHCP server to supply network configuration is fine, everything else is making things complex. You may need to install ifupdown and disable the netplan thing to achieve this.
 +
* sudo apt-get purge network-manager
 +
* Uninstall dhcpcd
 +
* Uninstall openresolv
 +
These 2 needed to be done on a raspberry pi running debian buster
 +
* uninstall wicd
 +
* disable avahi  (systemctl disable avahi-daemon)
 +
 
 +
===Snap===
 +
Another bad and confusing idea is snap. E.g. [[Jupyter]] I could not get working the way I want it with the Jupyter snap.
 +
Remove it like described by [https://techwiser.com/remove-snap-ubuntu/ techwiser].
 +
First remove all snaps, then removed snap itself and make sure it will not reappear.
 +
<syntaxhighlight lang=bash>
 +
snap list
 +
snap remove --purge <package-name>
 +
rm -rf /var/cache/snapd/
 +
apt autoremove --purge snapd gnome-software-plugin-snap
 +
rm -fr ~/snap
 +
apt-mark hold snapd
 +
</syntaxhighlight>
 +
 
 +
When using this anyhow. Some snaps (like firefox) may send daily warnings an update is pending. For some reason this does not happen automatically and you need to execute <code>sudo snap refresh</code> to do the update.
 +
 
 +
The snap-store cannot be updated from the ubuntu software catalog as the process is running always. To update:<br>
 +
<code>snap-store --quit && sudo snap refresh snap-store</code>
  
 
===Settings GUI===
 
===Settings GUI===
Line 29: Line 54:
 
:Turn off the VGA display. The name may differ on other configurations.
 
:Turn off the VGA display. The name may differ on other configurations.
  
==Add applications==
+
===Slow boot===
To add an application to the 'Open with' list edit /usr/share/applications/newapp.desktop.
+
# If /var/log/syslog is full of messages like '<code>failed to bind to /tmp/.X11-unix/X....</code>', make sure / is owned by root.
 +
# Check [[Networking#Interfaces]] for allow-hotplug
 +
 
 +
===Tracker===
 +
Tracker is a part of nautilus scanning your filesystem. I don´t need that.
 +
apt purge nautilus
 +
apt install thunar
 +
 
 +
===Get a visible border on the gnome terminal===
 +
vi .config/gtk-3.0/gtk.css
 +
 
 +
terminal-window notebook {
 +
  border-width: 0px 1px 1px 1px;
 +
  border-style: solid;
 +
  border-color: grey;
 +
}
 +
 
 +
terminal-window.maximized notebook,
 +
  terminal-window.fullscreen notebook {
 +
  border-style: none;
 +
}
 +
 
 +
==Application management==
 +
 
 +
;apt install <package>
 +
:Install a new package
 +
;apt remove --purge <package>
 +
:Remove a package and all related files
 +
;apt update
 +
;apt full-upgrade
 +
:Update the package meta-data and update all
 +
 
 +
;apt-get autoclean
 +
:Remove all obsolete package files from /var/cache/apt/archives. Do this every now and then
 +
 
 +
;do-release-upgrade
 +
:Upgrade to the latest Ubuntu release, latest LTS if that is what you run.
 +
 
 +
;dpkg -i <packagefile>
 +
:Install from the packagefile
 +
 
 +
===Add applications===
 +
To add an application to the 'Open with' list edit /usr/share/applications/<newapp>.desktop.
  
 
For opening jupyter notebooks I added jupyter.desktop that looks like below.
 
For opening jupyter notebooks I added jupyter.desktop that looks like below.
Line 48: Line 115:
 
  StartupNotify=true
 
  StartupNotify=true
 
  Keywords=Python;Editor;
 
  Keywords=Python;Editor;
 +
 +
===Autostart applications===
 +
To automatically start an application when a user logs in put a link to /usr/share/applications/<newapp>.desktop or a new <newapp>.desktop in ~/.config/autostart
 +
 +
===Problem upgrading package like 'errors were encountered while processing'===
 +
It is pretty old but some good hints can be found on [https://journalxtra.com/linux/fixing-the-dreaded-errors-were-encountered-while-processing-errors/ journalxtra.com]

Latest revision as of 11:07, 18 March 2024

Ubuntu is a linux distribution derived from debian. It's a very nice plug&play OS with all features I need.

cat /etc/os-release
cat /etc/lsb-release
lsb_release -a
Show the currently installed version. os-release has most information.

Modfications made

The few things I needed to tweak are listed here.

NetworkManager

NetworkManager is a bad idea, just use /etc/network/interfaces and /etc/resolv.conf to configure your network. Having a DHCP server to supply network configuration is fine, everything else is making things complex. You may need to install ifupdown and disable the netplan thing to achieve this.

  • sudo apt-get purge network-manager
  • Uninstall dhcpcd
  • Uninstall openresolv

These 2 needed to be done on a raspberry pi running debian buster

  • uninstall wicd
  • disable avahi (systemctl disable avahi-daemon)

Snap

Another bad and confusing idea is snap. E.g. Jupyter I could not get working the way I want it with the Jupyter snap. Remove it like described by techwiser. First remove all snaps, then removed snap itself and make sure it will not reappear.

snap list
snap remove --purge <package-name>
rm -rf /var/cache/snapd/
apt autoremove --purge snapd gnome-software-plugin-snap
rm -fr ~/snap
apt-mark hold snapd

When using this anyhow. Some snaps (like firefox) may send daily warnings an update is pending. For some reason this does not happen automatically and you need to execute sudo snap refresh to do the update.

The snap-store cannot be updated from the ubuntu software catalog as the process is running always. To update:
snap-store --quit && sudo snap refresh snap-store

Settings GUI

One day I could not start the settings GUI anymore. Removing the unity-control-center fixed the problem one time. On another install it didn't.

sudo apt-get remove unity-control-center

Display

When I connect a monitor to my laptop on HDMI automatically a 3rd VGA display is found.

xrandr --listactivemonitors
Show all active monitors
xrandr --output VGA-1-2 --off
Turn off the VGA display. The name may differ on other configurations.

Slow boot

  1. If /var/log/syslog is full of messages like 'failed to bind to /tmp/.X11-unix/X....', make sure / is owned by root.
  2. Check Networking#Interfaces for allow-hotplug

Tracker

Tracker is a part of nautilus scanning your filesystem. I don´t need that.

apt purge nautilus
apt install thunar

Get a visible border on the gnome terminal

vi .config/gtk-3.0/gtk.css
terminal-window notebook {
  border-width: 0px 1px 1px 1px;
  border-style: solid;
  border-color: grey;
}
terminal-window.maximized notebook,
  terminal-window.fullscreen notebook {
  border-style: none;
}

Application management

apt install <package>
Install a new package
apt remove --purge <package>
Remove a package and all related files
apt update
apt full-upgrade
Update the package meta-data and update all
apt-get autoclean
Remove all obsolete package files from /var/cache/apt/archives. Do this every now and then
do-release-upgrade
Upgrade to the latest Ubuntu release, latest LTS if that is what you run.
dpkg -i <packagefile>
Install from the packagefile

Add applications

To add an application to the 'Open with' list edit /usr/share/applications/<newapp>.desktop.

For opening jupyter notebooks I added jupyter.desktop that looks like below. I don't think everything is needed but it works.

[Desktop Entry]
Type=Application
Version=1.0
Name=Jupyter
GenericName=Jupyter notebook
Comment=Prototyping and documentation 
Exec=jupyter notebook %F
Icon=jupyter
Terminal=false
Categories=GTK;Development;IDE;
MimeType=text/plain;text/x-python;
StartupNotify=true
Keywords=Python;Editor;

Autostart applications

To automatically start an application when a user logs in put a link to /usr/share/applications/<newapp>.desktop or a new <newapp>.desktop in ~/.config/autostart

Problem upgrading package like 'errors were encountered while processing'

It is pretty old but some good hints can be found on journalxtra.com