Is there a way to install a package via a simple URL without having to add a PPA beforehand? Something like apt-get https://url.to.package.deb
? Or perhaps some command line options that would add the PPA, update, and install the package all at once? Seems like I've seen other package managers that do this. I just find it a hassle to type the commands to add a whole repository just so I can install only one of its packages.
3 Answers
If you already know the .deb
file link, then download that deb file by,
wget https://url.to.package.deb
If you want to download a package then run,
apt-get download <package-name>
It will download all the .deb files related to the package.Finally install all the .deb
files by running,
sudo dpkg -i filename.deb
Just remember that a PPA, or any other apt
repository, is not just about installing packages. It's also about automatically updating them. And the hassle of manually checking for updates, download and upgrade packages yourself is far worse than just adding a repository.
Compare the 2 workflows:
Adding a repository and installing from it:
- Add the PPA repository. What you call "hassle" is for now is a single command:
sudo apt-add-repository ppa:user/repo
- Install the package:
sudo apt install package
Doing all yourself:
- Visit the software website and find the correct version for your platform (32 or 64 bits? PC, Mac or Raspberry? Ubuntu 18.04 or 22.04?)
- Download the
.deb
:wget https://xxx.com/yyy.deb
- Install the package:
sudo dpkg -i yyy.deb
- Some time later (2 months? 1 week?), visit the software website again to see if there are any updates
- If so, do most of above steps again
Repositories save you from all this trouble.
-
I can see how it would be less trouble in the long run to add the PPA within the design constraints of how apt works. However, I wonder why the package itself doesn't just include meta data about where it can be updated so that as a user I don't have to maintain this manually.– AdamOct 14, 2022 at 20:26
-
1@Adam: some packages do contain code to add their repository when the package is installed, such as from Oracle, Microsoft and Google. But many consider this a security risk and a poor practice. Oct 27, 2022 at 14:57
-
And what would be the benefits of such metadata? You'd still have to go to the developer website (possibly having to find out who and where it is), then select the appropriate version for your platform, then download and then install. That's a lot of hassle even if needed only once per package. Oct 27, 2022 at 15:01
If I understand your question correctly, Not really. By using something like
sudo add-apt-repository ppa:<goalppa/ppa>
you are telling your system that you want the (file/program/code) you download from this ppa to be supported from this location and get updates from there.
Its a security question for sure, allowing new ppa's that is. But the security concerns for just getting the (file/program/code) may be greater in the long run if it develops a security problem down the line. Also easier to get super delicious updates (Mmmmmm updates).