18.04 – How to delete an aptly published snapshot

Using Ubuntu 18.04 and aptly version 1.4.0.

I am attempting to create a focal mirror using aptly, as follows:

aptly mirror create --architectures="amd64" -filter-with-deps -filter="Installed-Size (<=500000)" focal http://uk.archive.ubuntu.com/ubuntu focal main restricted universe multiverse
aptly mirror update focal
aptly snapshot create focal-latest from mirror focal
aptly publish snapshot --skip-signing focal-latest filesystem:export:export

This seemed to work OK — but I made a small mistake and want to delete the published snapshot and redo it.

How does one do this please? The command line help shows this:

Usage: aptly publish drop <distribution> ((<endpoint>:prefix)

I presume <distribution> is what aptly publish snapshot refers to as <name> but I have been unsuccessful divining the correct format to use. I have tried dozens of combinations, but here are a few, and the results:

$ aptly publish drop focal-latest
ERROR: unable to remove: published repo with storage:prefix/distribution ./focal-latest not found
$ aptly publish drop focal-latest filesystem:export:export
ERROR: unable to remove: published repo with storage:prefix/distribution filesystem:export:export/focal-latest not found
$ aptly publish drop focal-latest filesystem:export
ERROR: unable to remove: published repo with storage:prefix/distribution filesystem:export/focal-latest not found

18.04 – Can someone explain me what this is and how I stop it?

When you see a “change in progress” message it means that Snap is working on something in the background. You can get a list of what’s going on in the Terminal like this:

snap changes

If Snap does have something going on, then you’ll see a message like:

123  Doing   2021-05-06T00:00:00Z  -  Remove "opera" snap

Otherwise, you’ll see:

error: no changes found

If you need to abort a Snap change, you can do this:

sudo snap abort {ID}

Note: {ID} is found in the result of snap changes.

18.04 powers off during boot or soon thereafter

I have a Ubuntu 18.04 system that I created to provide remote access to our office March 2020, when the COVID-19 lockdowns started. It has been running great since then … until an update a couple days ago. Now it runs for no more than a few minutes and often powers itself down during the boot sequence without ever reaching the login prompt! That makes it extremely difficult to work on, to say the least.

I used my phone to video the boot sequence (because it disappears too fast to read) and found that when it powers down during a power on sequence, the last message logged to the screen is this:

(  3.144966) fb: switching to nouveaufb from VESA VGA

After that, the screen goes black and the power light on the computer goes out.

Is there any way to recover from this? FYI: I’m no linux/ubuntu expert, so I may need a few more details than are sometimes provided in answers here… (smile) I will try to discover any information requested, but I need to be able to collect it FAST during my very limited time when I can login (and those are few.)

networking – How to enable Nautilus in Ubuntu 18.04 to share a folder?

To share a folder in Nautilus, I have first installed samba via

sudo apt install samba

Next, I had also used synaptic to install nautilus-share (a Nautilus extension to share folder using Samba).

Thereafter, I have used the mouse to right-clicked on the folder that I had wanted to share. aHowever, I could not see the Local Network Share option there. Neither do I see a Local Network Share tab after clicking on Properties.

How do I enable nautilus to share a folder?

system installation – Ubuntu 18.04 – debian installer (preseed) not respecting max size on partitions

I am using preseed to do an unattended install of Ubuntu 18.04 using the following recipe, but it ends up with the lv_swap partition filling up the disk and it ends up with 60+GB.

How can I make the partitions respect the size described on the recipe:
1 GB /boot
20GB / (LVM)
20GB /var (LVM)
4 GB swap (LVM)
rest would be free space on LVM to be used later

d-i partman-auto/expert_recipe string
boot-root ::
1 1 1 free
$bios_boot{ }
method{ biosgrub }
1024 1024 1024 ext4
$primary{ }
$bootable{ }
method{ format } format{ }
use_filesystem{ } filesystem{ ext4 }
mountpoint{ /boot }
20480 20480 20480 ext4
$lvmok{ }
method{ format } format{ }
use_filesystem{ } filesystem{ ext4 }
mountpoint{ / }
lv_name{ lv_root }
20480 20480 20480 ext4
$lvmok{ }
method{ format } format{ }
use_filesystem{ } filesystem{ ext4 }
mountpoint{ /var }
lv_name{ lv_var }
4096 4096 4096 linux-swap
$lvmok{ }
method{ swap } format{ }
lv_name{ lv_swap }

Thank you!

18.04 – Running Python script on WSL causes error due to ^M

Running Ubuntu 18.04 under WSL, I have one .py file that if I do:

$ ls -la foo.py 
-rwxrwxrwx 1 ken ken 6778 Apr 25 15:16 foo.py
$ ./foo.py
bash: ./foo.py: /usr/bin/python3^M: bad interpreter: No such file or directory

If I do the full:

$ python ./foo.py

The script runs as normal. Also, this works:

$ touch bar.py
$ chmod +x bar.py
$ ./bar.py

This happens both in the raw bash shell and the VSCode terminal window. Why might my file cause such an error?

ubuntu 18.04 – nginx home page wont load

after installing Nginx, it installed without error but when i tried to check it out with http://localhost i received this error message

setStart($startTime, $startMem)->mark(‘afterLoad’) : null; // Instantiate the application. $app = JFactory::getApplication(‘site’); // Execute the application. $app->execute();

i have even tried using my serverIP, got same error Please i need help…. need to installl joomla as a school project

boot – How to make Ubuntu 18.04 and Visual Studios run faster?

I am new to Ubuntu Linux and just installed version 18.04 on my computer alongside Windows in dual-boot mode. However, after three weeks, Linux started to be very slow, and it will even crash a few times a day when it is not able to run my code efficiently enough. It will stop building a package completely when I run catkin build such that I am forced to switch off my laptop.

I have tried the following:

  • Looking at CPU specs with lspcu, which are good

  • Looking at the omputer make and model, gotten with the system information part of sudo dmidecode | less

  • Some of the solutions found on the following website: https://www.maketecheasier.com/linux-running-too-slow-heres-how-to-find-the-cause/. Such as: checking my CPU size (seems okay), examine CPU load with top (no process seems to be abusing my CPU usage) and check if my hard drive is overworking with iotop (it is not).

  • Examining the system with systemd-analyze blame:

            19.606s apt-daily.service
            6.913s NetworkManager-wait-online.service
            4.019s plymouth-quit-wait.service
            3.163s apt-daily-upgrade.service
            2.258s bolt.service
            1.391s snap-gnomex2d3x2d34x2d1804-66.mount
            1.354s snap-onenotex2ddesktop-13.mount
            1.352s snap-gnomex2dcalculator-826.mount
            1.337s dev-sda7.device
            1.332s snap-gnomex2dcharacters-570.mount
            1.241s snap-dub-53.mount
            1.206s snap-gtkx2dcommonx2dthemes-1514.mount
            1.172s snap-snapd-11107.mount
            1.100s snap-gnomex2dcalculator-884.mount
            1.031s snap-gnomex2dsystemx2dmonitor-148.mount
            1.013s snap-gnomex2dlogs-103.mount
             993ms snapd.service
             971ms snap-core-10958.mount
             912ms snap-code-59.mount
             911ms dev-loop4.device
             878ms dev-loop5.device
             857ms fwupd.service
             835ms dev-loop2.device

It seems like the upper lines are taken up a lot of time, so maybe this is a cause of the problem?

  • It should be noted that my Ubuntu running slow is mainly caused when I am using Visual Studio Code for too long – when my Ubuntu has just started, it runs fine, but after a while it gets slower and slower. I checked again with the top command the CPU usage when running a code in Visual Studio Code and it seems like maybe this causes a problem since cc1plus command runs at 99-100% CPU:

Result of top command: cc1plus running at 99-100% CPU

  • I have looked at /var/log/syslog errors as well with cat var/log/syslog | grep 'error' and the following error occurred multiple times:
Apr 16 13:48:06 jessie-HP-ZBook-Studio-G3 gnome-shell(1321): Error setting property 'Powered' on interface org.bluez.Adapter1: GDBus.Error:org.bluez.Error.Blocked: Blocked through rfkill (g-io-error-quark, 36)

Other errors that occur (not as often, though) are:

Apr 16 13:48:07 jessie-HP-ZBook-Studio-G3 org.gnome.Shell.desktop(1957): (4212:4212:0416/134807.054559:ERROR:gpu_service_impl.cc(1177)) Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
Apr 16 15:11:04 jessie-HP-ZBook-Studio-G3 kernel: ( 6106.242652) traps: ocs2_controller(14048) general protection fault ip:7f96415d58da sp:7ffd54f40af8 error:0 in libocs2_centroidal_planner.so(7f96414fa000+258000)
Apr 16 15:18:21 jessie-HP-ZBook-Studio-G3 org.gnome.Shell.desktop(1957): Fontconfig error: Cannot load default config file: No such file: (null)
Apr 16 16:36:57 jessie-HP-ZBook-Studio-G3 kernel: (    0.173308) ACPI Error: Aborting method _SB._OSC due to previous error (AE_AML_BUFFER_LIMIT) (20190816/psparse-531)
Apr 16 16:36:57 jessie-HP-ZBook-Studio-G3 kernel: (    6.312196) EXT4-fs (sda7): re-mounted. Opts: errors=remount-ro
Apr 16 16:36:57 jessie-HP-ZBook-Studio-G3 kernel: (    6.736341) hp_accel: probe of HPQ6007:00 failed with error -22
Apr 16 16:36:59 jessie-HP-ZBook-Studio-G3 snapd(1048): stateengine.go:150: state ensure error: Get https://api.snapcraft.io/api/v1/snaps/sections: dial tcp: lookup api.snapcraft.io: no such host
  • Finally, I went to the folder /var/crash and look for files there (ls -a), however, no files are found, the only thing my terminal displays are dots: . ..

Anyone who has any idea where to look for the cause of these crashes when running code, and if the main cause is my Ubuntu / dual boot or Visual Studio Code? I am sorry for stating such an unclear general question. If anything else is needed I’ll provide it.