« first day (13 days earlier)      last day (37 days later) » 

9:17 AM
ATB @karel ! I hope you will rock the explanation today ;)
 
 
5 hours later…
1:55 PM
You don't have to be a cuttlefish to install software in Ubuntu the cosmic way. I didn't think Ubuntu 18.10 cosmic cuttlefish was very cosmic because it had a few bugs in it, but my Ubuntu 20.04 has no bugs in it except for a minor feature in GIMP which I have never used doesn't open when it's selected. It doesn't crash the application, so I don't count it as a bug. I reported the bug using apport in order to remove the error notifications that I got when launching GIMP.
Another factor that greatly influences the software installation experience is the choice of release. If your computer is new you should use the latest LTS release or newer. My production computer which was purchased in early 2020 is running Ubuntu 20.04 which was which was upgraded from 18.04. Upgrading Ubuntu from 18.04 to 20.04 made a noticeable improvement in performance.
I haven't ever used a PPA software source except in a virtual machine. Sometimes I simulate installing a package from a different Ubuntu release that I manually downloaded from Ubuntu Package Search with apt install --simulate package-name to see if installing this package would cause any "broken packages" error messages. If there are too many unmet dependencies then I don't install this package except in a virtual machine.
I use appimage to install applications locally in my home directory that are not available from th default Ubuntu repositories. You can search for appimage applications at AppImageHub. Appimage apps are often buggy though. I really like the App Outlet appimage, except that it's buggy. App Outlet is a software center that searches for snap, flatpak and appimage packages which is a lot easier than searching for apps in a web browser when it works.
Sometimes I use a Python virtual environment to install Python packages with pip. You can either use python3-virtualenv or use the built in Python virtual environment creator in PyCharm IDE. Python 2.x is not maintained since January 2020, so I don't install Python 2.x packages with pip anymore.
That's my easy introduction to software installation. As a bonus I'll throw in a screenshot of how to use a non-default repository to install and update just one or two packages without it being able to break your system's package management for any other packages. I have uploaded the markdown text of the screenshot to Ubuntu Pastebin so that you can copy/paste the commands in it.
If you have any questions about specific software installation problems feel free to ask them here.
 
Hi and welcome to Ask Ubuntu Classroom everyone!
First off I want to say thanks to everyone who has helped us get to this far. Especially @Zanna doing all the hard work organising the celebration of the event.
 
 
And much thanks to @karel for opening the class room session regarding software installation. Thanks again Karel.
 
Click on the above image to enlarge it.
 
@karel I really love the -s flag
I wonder how many users are unaware of it
seems like we might get a few less questions if it was better known
 
2:01 PM
I don't know what -s flag is. Can someone explain me what is it?
 
one small problem with the APT documentation IMHO is that man apt doesn't have many of the useful options listed
 
@Zanna --simulate is one of my favorites along with rmadison, apt-cache depends package-name and apt-cache rdepends package-name
 
if you check man apt-get instead you can see the entry for -s --simulate
 
What's the difference between dpkg and apt?
 
@AbhayPatil when you add the -s flag in your apt install or apt remove command, instead of actually running the command, it shows you what would be done, if you actually ran the command
 
2:05 PM
@Zanna something like a trial?
 
based on the info in the dpkg database... it does warn that the simulation may not be reliable
 
@karel what does rmadison command do?
 
@technastic_tc yes, or a "dry run" (the dpkg commands has a --dry-run flag which is also called --simulate which does something similar)
 
@Zanna and how is that usefull? I mean under what situations would it be helpful?
 
@AbhayPatil I find it most useful when considering removing a package
you can see with -s that a whole load of other packages would get removed as well
then you can decide not to remove that particular package
 
2:10 PM
@Zanna is that really install the package then purge it, or no hard (write) installation happening?
 
apt is a pretty good tool for managing packages generally, but there are a few things that dpkg can do that apt can't do. In general I use apt for everything and if I can't figure out how to do it with apt I refer to my list of dpkg commands.
 
@Zanna But when you remove a package, doesn't it ask for your confirmation before actually removing the packages. It lists the packages which will be removed
 
dpkg-query -L <package_name> # which files are in an installed package
dpkg-deb -c <package_name.deb> # which files a .deb file will install
sudo dpkg --force depends -P # force depends to be purged
sudo dpkg-reconfigure PACKAGE_NAME # reconfigure an existing package
dpkg -S /path/to/file find package that provides a file if that package is installed
dpkg-query - query the dpkg database about package status
sudo dpkg --get-selections | grep nvidia # show list of available nvidia drivers
sudo dpkg --remove --force-remove-reinstreq <package_name> # stronger way to remove broken packages. A package marked reinstreq is broken and requires reinstallation. These packages cannot be removed, unless forced with option --force-remove-reinstreq. After removing broken packages update the list of available software with sudo apt update
dpkg --get-selections *php* # list all the php packages that are currently installed on your system through apt-get
dpkg –get-selections w* # list all the currently installed packages that start with the letter w
dpkg -L geany # list locations (paths) of installed geany files
 
@αғsнιη it doesn't actually do the installation. (Not all apt operations are reversible). If you simulate an install command, it doesn't download anything so you don't use up any of your data allowance, for example
 
2:13 PM
@AbhayPatil yes, it shows what other packages would be removed and you can abort it, but it's still nice to have the option of a simulation where you can't accidentally confirm and complete the operation
 
Zanna see in this image it first asked me whether I would really want to remove those packages, If I say no then it just aborts. So, I don't really see why --simultae would be helpfull
@Zanna Sure even that makes sense
 
Simulate can be helpful when someone is helping a newbie remotely I guess
 
@karel nice list!
@technastic_tc good point
although your system might be different
apt doesn't ask for confirmation if there is nothing else to remove/install
 
I don't use that cheatsheet very often. For what I do apt is usually enough most of the time.
 
it only asks for confirmation if additional packages are involved. So you can use simulate if you don't actually want to remove/install the package (like @technastic_tc says, if you want to help someone else or you are just curious or whatever)
 
2:17 PM
How has the recent developments of snap and flatpak help with the software installation troubles?
 
@karel SO does that mean dpkg is a more powerfull tool, which is also more complex to use, when compared to apt?
 
@karel I guess --force-remove-reinstreq can be really useful if things are messed up, but why are such packages not removeable? Can bad things happen when using that flag?
 
@Zanna Got it
 
:)
 
@AbhayPatil This is a useful question regarding apt vs dpkg. In short, apt is better at managing dependencies. However, it's not the best tool to use for scripting, where apt-get or dpkg should be preferred.
 
2:20 PM
@jokerdino rmadison is a terminal program that queries the database and returns the versions of the selected .deb file in the default Ubuntu repositories for all currently supported Ubuntu versions and also precise, trusty and groovy. It's a very useful tool and it's much faster than Ubuntu Packages Search. There is an option to query for Debian packages too.
 
@user3140225 Thanks
 
@AbhayPatil I'm currently working on getting a gold badge for the apt tag, so I try to use apt instead of dpkg whenever possible which is most of the time.
 
I personally feel man page of apt or dpkg complex. Is there any alternative websites which we can refer to understand how a command exactly works? I sometimes feel Computer Hope is good..
 
@Zanna --force-remove-reinstreq is useful for people who have done something bad with package management possibly by using a PPA and they are stuck with a version of a package that apt doesn't like. It is useful in cases where the user wants to remove the PPA version of a broken package.
 
@user3140225 Isn't apt a better version of apt-get
 
2:29 PM
apt is better than apt-get most of the time, but there are still some features of legacy apt-get that apt doesn't have.
 
@karel thanks!
@technastic_tc I feel that some man pages are better than others - what I really like are examples
I think we could go through those pages here and now if everyone is up for that?
(the man pages for apt, dpkg, apt-get)
 
@Zanna ok!
 
@Zanna yeah sure
@karel got it
 
for more detail on how they work and interact, you might be interested in reading the Debian wiki page about dpkg
ok that's totally not the page I was thinking of
but still, maybe it helps haha
 
@technastic_tc Linux guru Wildcard has the key for untangling the complexities of using man apt-get and man apt in this answer.
 
2:34 PM
@AbhayPatil Both commands are considered equivalent for the most part, as apt is like a wrapper around apt-get and apt-cache and is more colorful than apt-get. However apt-get offers some options not available in apt.
 
@user3140225 do you (or @karel) know which options to apt-get are not available to the apt command?
 
@karel ok!
 
my issue is that many apt options are available but only documented in the apt-get manual page. I don't know of any specific options that apt-get has that apt does not have
 
@Zanna Well one difference I know is full-upgrade vs dist-upgrade.
Do they work the same way?
 
@Zanna man apt doesn't tell you all of apt's options. As far as I'm concerned if it's in man apt-get but not in man apt I try running the same command in apt and it works almost all the time. If it doesn't work in apt then I revert to apt-get.
 
2:38 PM
haha makes sense :D
@AbhayPatil I am not sure... I thought so, but I think I may have been told something to the contrary. I'll see if I can find anything
 
@Zanna askubuntu.com/a/1160211/1067851 I found this interesting answer
 
@Zanna Hmmm. I remember that some years ago, I tried to run apt clean, but the command was returning an error. Now that I looked again it seems that it works. One of two things can be happening: 1. I don't remember correctly or 2. clean was implemented for apt too.
This is a nice question about apt vs apt-get.
And I just found in the above question that apt offers edit-sources, which is really handy for manually editing the package sources.
 
Any features which APT has and Yum doesn't have?
 
2:54 PM
@AbhayPatil looking at the source code, seems they do exactly the same thing
but I'm a total novice to, like, all the programming languages
@user3140225 I've never tried it!
zanna@peach:~$ apt -s dist-upgrade > 1 && apt -s full-upgrade > 2 && diff 1 2

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.


WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

zanna@peach:~$
no difference found ^
zanna@peach:~$ apt-get -s dist-upgrade > 1 && apt -s full-upgrade > 2 && diff 1 2

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

2c2
<       apt-get needs root privileges for real execution.
---
>       apt needs root privileges for real execution.
zanna@peach:~$
 
well you did not check the source code
 
haha very small difference found (I expected that on STDERR)
@AbhayPatil I did...
 
you just compared the output of both the commands
 
I checked the source code... then I compared the output
 
@Zanna I mean the commands you posted above just compares the output and not the source code
where did you find the source code?
 
3:02 PM
I downloaded it using apt source apt
@AbhayPatil yes I know, sorry for the lack of clarity
 
@Zanna However you demonstrated a difference between apt and apt-get: WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
 
zanna@peach:~/apt-1.9.4ubuntu0.1$ grep -r 'DoDistUpgrade'
cmdline/apt-get.cc:      {"dist-upgrade", &DoDistUpgrade, _("Distribution upgrade, see apt-get(8)")},
cmdline/apt-get.cc:      {"full-upgrade", &DoDistUpgrade, nullptr},
cmdline/apt.cc:      {"full-upgrade", &DoDistUpgrade, _("upgrade the system by removing/installing/upgrading packages")},
cmdline/apt.cc:      {"dist-upgrade", &DoDistUpgrade, nullptr},
apt-private/private-upgrade.h:APT_PUBLIC bool DoDistUpgrade(CommandLine &CmdL);
apt-private/private-upgrade.cc:// DoDistUpgrade - Automatic smart upgrader                             
@user3140225 yes - that was on STDERR
 
@Zanna cool
 
you can probably read the source code here instead of downloading it
 
@Zanna I have seen a couple of questions where users try to use awk or sed to manipulate apt's output to use it in a script, when apt-get could be used as-is (or almost as-is).
 
3:06 PM
@Zanna thanks
 
@user3140225 I wonder why they don't just make the interface "stable" but I think we also have a question about that
@AbhayPatil you're welcome - sorry for the various confusing messages!
I wasn't sure which part of my poking around in the source code would be useful instead of being a cryptic wall of text, but it seems I have just generated several of those
 
@Zanna I suppose you mean this question. I suppose that the developers have their reasons for not making it stable.
 
@Zanna From what I see is that full-upgrade and dist-upgrade have swapped meaning in the apt and apt get
APT_GET says the following
{"dist-upgrade", &DoDistUpgrade, _("Distribution upgrade, see apt-get(8)")},
{"full-upgrade", &DoDistUpgrade, nullptr},
APT says this
{"full-upgrade", &DoDistUpgrade, _("upgrade the system by removing/installing/upgrading packages")},
{"dist-upgrade", &DoDistUpgrade, nullptr},
so basically full-upgrade in apt-get is exactly same as dist-upgrade in apt, and dist-upgrade in apt-get is exactly same as full-upgrade in apt
Strange isn't it. I mean why would they do that??
 
@AbhayPatil that's my interpretation
 
@Zanna Well that is correct as far as the source code goes
 
3:14 PM
@AbhayPatil I think they just wanted to give it a more user-friendly name
 
Do apt dist-upgrade and apt full-upgrade, do different things?
 
I think dist-upgrade means distribution upgrade, like from one whole system version to the next. But it only does that if you edit sources.list (and upgrading to a new version that way in Ubuntu is not supported) (APT comes from Debian, where that method is supported)
@AbhayPatil that post you found said that apt just "accepts dist-upgrade as an alias for full-upgrade" I think. But I believe it's just that apt is a wrapper for apt-get so it's just the same dist-upgrade being called whether from apt or apt-get. Is that reasonable?
 
@AbhayPatil As far as I can tell from the code you posted, they are exactly the same thing. Whether you use dist-upgrade or full-upgrade, in either apt or apt-get, the result is that a function called &DoDistUpgrade is executed.
 
But the source code does not agree with that
 
No matter what you write, what is called is &DoDistUpgrade.
Then again, my understanding of C or C++ is very limited so I may well be wrong. That is what it looks like though.
 
3:23 PM
@terdon what about the another parameter passed. It is a string in one case and NULL in the other case. I thing DoDistUpgrade is a function pointer and the next part (NULL, and the string part) are some sort of parameter. And if you are familiar with coding, parameters do change the execution very significantly
 
@AbhayPatil The parameter here is just the string that describes what is done. That will presumably be included in some automatically generated help message or documentation.
Where did you find this code, can you link to it?
At least in Debian's source, there's even a comment explaining that this is only there for compatibility with muscle memory, so that users who are used to typing dist-upgrade can still do it with the same command and don't need to get used to writing full-upgrade instead:
     // for compat with muscle memory
      {"dist-upgrade", &DoDistUpgrade, nullptr},
 
@terdon I got it from the same place as yours, debian github
@terdon makes sense
 
I can't find the apt-get one, but since the only parameter is a descriptive string, it's sae to assume it is just used as a description.
 
So can we conclude that dist-upgrade is same as the full-upgrade?
 
@terdon haha nice comment
 
3:32 PM
@AbhayPatil certainly seems that way, yes.
@Zanna :)
 
Why should we use checkinstall instead of make install?
 
checkinstall is a nice tool to create simple .deb packages that you can use in your local network (e.g. if you have to install the same piece of software on multiple computers running Debian). It lets you compile and install software from the sources like before, but with the difference that you end up with a simple Debian package which also means that you can easily uninstall the software you just compiled by running dpkg -r
 
@karel Thanks!
 
3:51 PM
@karel I've never tried appimage. What do you like about using it?
 
appimage installs packages anywhere in your home directory without root permissions necessary. This lets me install crazy packages that save me a lot of time, for example App Outlet which is a software browser for snap, flatpak and appimage packages that is faster than web searching in three different places for the same package. App Outlet also has a better user interface similar to the Software app in 20.04.
 
App Outlet does sound really useful
 
The problem with App Outlet is that sometimes it doesn't connect to the internet to retrieve information about packages.
Another applimage that I used to use is Marktext markdown editor which used to do a better job of formatting copy/pasted web content than Typora from the Software app, but Typora has improved with updates so I don't use Marktext anymore.
 
so Typora is in Ubuntu repositories?
 
Typora is a snap package.
 
4:00 PM
oh right :)
I'm clueless about snap, flatpak and appimage
 
@karel What about flatpaks? My experience with them is with the nomacs image viewer. I installed the latest version of it using flatpak and all was well (reasonably fast, themes ok, etc), but I wasn't able to run nomacs from the terminal.
 
I have an idea of the concept - the package comes with all its dependencies, so you avoid the usual package management tangles - but I don't have any experience with them, except, like, once I tried installing a snap and it didn't work so I installed the software another way
 
I haven't found any flatpak packages that I like. I think snap packages are the best of the three choices for most Ubuntu users.
 
we actually reached the end of the scheduled time for the class (but @karel it's up to you if you want to continue!). I feel bad for butting in earlier. I'm sorry about that. I didn't expect those sidetracks to expand so much.
 
@karel Hmmm. OK.
 
4:05 PM
Thank you so much for giving the lesson @karel
 
Thanks @karel !
 
@Zanna I didn't expect anything, and didn't know if there would be enough user interest to fill a two hour time slot. Your choice of a time slot was successful.
 
@karel Thank you!
 
So hang on. In the Ubuntu world you now have snaps, flatpacks and debs? Three separate methods of installing software?
 
Thank you @user3140225 @technastic_tc @AbhayPatil @jokerdino @terdon for participating and asking questions
 
4:08 PM
and appimages
 
Whaa? appimages like in macOS?
 
@karel I think we could go on and on for days about this topic
which would be fine :D
 
appimages are secure, but usually buggy. I prefer snap packages to flatpak and appimage packages.
 
Thank you @Zanna @jokerdino for helping @karel organise the event!
 
Appimages don't actually install though, right? You just mount the image and run whatever's there.
 
4:09 PM
@Zanna Thanks for organizing the lessons!
 
we could continue the conversation about software installation in AUGR :)
(I mean, we can also continue it here, I'm just hoping to revive AUGR)
 
Running an appimage is like running an .sh shell script file.
 
@user3140225 :)
 
@karel In the sense that you don't need to copy any files onto your system, you mean?
 
I just put the appimage files in my Downloads directory.
 
4:15 PM
@karel Snaps generally take more resources (ram, storage), and are slower to launch. They don't integrate well with the host OS, (ex: font and font size, theme, etc), but are much more secure and are well sandboxed.
 
BBYYYEE!!
 
thank you @karel for giving the lesson; thank you @Zanna @jokerdino for your support on organizing this event
 
thank you @αғsнιη for participating :)
 
@AbhayPatil Resource usage doesn't matter much to me and neither does launch time. The most important things to me are stability and performance which is what snap packages are good at.
 
4:19 PM
@karel Well I am not sure about the performance though, but stability is definitely better in snaps
 

« first day (13 days earlier)      last day (37 days later) »