Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 5257
Next
In Process

askthedev.com Latest Questions

Asked: September 25, 20242024-09-25T02:51:56+05:30 2024-09-25T02:51:56+05:30In: Linux, Ubuntu

How can I set up proxy configurations on Ubuntu without using a graphical user interface?

anonymous user

I’ve been diving into configuring my Ubuntu system lately, and I hit a bit of a snag that I could use some help with. I know there are ways to set up proxy configurations using the GUI, but the thing is, I’m trying to stick to terminal commands because I really want to learn the ins and outs of the system without always relying on the graphical interface.

Here’s where I’m stuck: I need to set up a proxy for both my regular internet traffic and for some specific applications. I’ve heard that setting it up via terminal can be more efficient and, honestly, it feels more “Linux-y” to me. But I’m not sure where to even start. I’ve tried looking up a few tutorials, but they all seem to assume that I’m already fluent in Linux commands, which I’m not quite there yet.

What I’m hoping for is a simple step-by-step guide to get me through the process. I’ve seen some mentions of files like `/etc/environment`, `~/.bashrc`, or using `apt` configurations, but honestly, I’m confused about which method I should be using. And what about setting up separate proxies for HTTP, HTTPS, and FTP? I read something about needing to specify those differently, and I’m worried I’ll mess something up if I don’t do it right.

Another challenge I’m facing is that I believe I might need to configure some applications throughout the system differently. For example, I’ve got certain tools that I use for development, and I need them to respect the proxy settings too. If anyone could break it down in layman’s terms, that would be great! I don’t need anything fancy, just the basics to get everything working smoothly.

If you’ve gone through this before or have any resources that could help, I’d really appreciate it! I just want to make sure I’m setting everything up correctly. It’s frustrating, but I know I’ll feel way more accomplished if I can get this working without a GUI. Thanks for any insights you might have!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-09-25T02:51:58+05:30Added an answer on September 25, 2024 at 2:51 am


      To set up a proxy configuration on your Ubuntu system using the terminal, you’ll primarily want to modify a few key files to ensure that both your internet traffic and specific applications are routed through the proxy as desired. Start by editing the `/etc/environment` file, which allows you to set global environment variables. Open the file in your favorite text editor with root privileges:

      sudo nano /etc/environment

      Within this file, add the following lines to configure your proxy settings:

      http_proxy="http://username:password@proxy-server:port/"
      https_proxy="https://username:password@proxy-server:port/"
      ftp_proxy="ftp://username:password@proxy-server:port/"
      no_proxy="localhost,127.0.0.1,::1"

      Make sure to replace `username`, `password`, `proxy-server`, and `port` with your actual proxy credentials and server information. After making these changes, save and close the file. Next, for users in a shell, you should update your `~/.bashrc` file by adding similar lines to have these variables available in your terminal session:

      export http_proxy="http://username:password@proxy-server:port/"
      export https_proxy="https://username:password@proxy-server:port/"
      export ftp_proxy="ftp://username:password@proxy-server:port/"
      export no_proxy="localhost,127.0.0.1,::1"

      Don’t forget to source the updated `~/.bashrc` by running `source ~/.bashrc` for the changes to take effect in your current terminal. Additionally, for package management via `apt`, you can configure proxy settings by creating or editing the `/etc/apt/apt.conf.d/99proxy` file:

      echo 'Acquire::http::Proxy "http://proxy-server:port/";' | sudo tee /etc/apt/apt.conf.d/99proxy

      For applications requiring distinct configurations, you may need to delve into their respective documentation to see if additional environment variables or configuration files are necessary. Tools like `wget`, `curl`, and development platforms might require similar proxy settings as outlined above, so ensure those applications are similarly informed.


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-09-25T02:51:57+05:30Added an answer on September 25, 2024 at 2:51 am



      Setting Up Proxy on Ubuntu via Terminal

      Setting Up Proxy on Ubuntu via Terminal

      First off, no worries! Setting up a proxy in Ubuntu using the terminal can seem a bit tricky at first, but I’ll try to break it down for you step-by-step.

      1. System-wide Proxy Configuration

      You can set up a system-wide proxy in the /etc/environment file. To do this, open the terminal and type:

      sudo nano /etc/environment

      Then, add the following lines to the bottom of the file (replace the proxy URL and port with your actual proxy details):

      http_proxy="http://your-proxy-url:port/"
      https_proxy="http://your-proxy-url:port/"
      ftp_proxy="http://your-proxy-url:port/"
      no_proxy="localhost,127.0.0.1,::1"

      After adding that, save the file (CTRL + X, then Y to confirm) and reboot your system.

      2. User-specific Proxy Configuration

      If you’d rather set it up for only your user, you can edit your ~/.bashrc file. Open it with:

      nano ~/.bashrc

      Add the same proxy variables as follows (again, replace the proxy URL and port):

      export http_proxy="http://your-proxy-url:port/"
      export https_proxy="http://your-proxy-url:port/"
      export ftp_proxy="http://your-proxy-url:port/"
      export no_proxy="localhost,127.0.0.1,::1"

      Save and exit, then run:

      source ~/.bashrc

      This will apply the changes immediately.

      3. Setting up Proxy for APT

      To make sure APT (the package manager) uses the proxy, create or edit the /etc/apt/apt.conf.d/proxy.conf file:

      sudo nano /etc/apt/apt.conf.d/proxy.conf

      Add the following lines (replace with your details):

      Acquire::http::Proxy "http://your-proxy-url:port/";
      Acquire::https::Proxy "http://your-proxy-url:port/";
      Acquire::ftp::Proxy "http://your-proxy-url:port/";

      Save and exit here too.

      4. Application-specific Proxy Configuration

      Some applications might need their proxy settings set separately. For example, for curl:

      export http_proxy="http://your-proxy-url:port/"
      export https_proxy="http://your-proxy-url:port/"

      You can put these lines in the relevant application’s config file, or enter them in the terminal before running the app.

      5. Final Thoughts

      For specific applications like Git or wget, you might need to set up proxies in their configuration files too.

      It might feel like a lot at first, but once you go through it a few times, it’ll become second nature. Just take it step by step, and you’ll get the hang of it!


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this issue?
    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?
    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. Has anyone experienced this issue ...
    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?
    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else encountered this problem, and what ...

    Sidebar

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this ...

    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?

    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. ...

    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?

    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else ...

    • How can I configure a server running Ubuntu to bind specific IP addresses to two different network interfaces? I'm looking for guidance on how to ...

    • Is it possible to configure automatic login on Ubuntu MATE 24.04?

    • After upgrading from Ubuntu Studio 22.04 to 24.04.1, I lost all audio functionality. What steps can I take to diagnose and resolve this issue?

    • I am experiencing issues booting Ubuntu 22.04 LTS from a live USB. Despite following the usual procedures, the system fails to start. What steps can ...

    • I'm encountering a problem with my Expandrive key while trying to update my Ubuntu system. Has anyone else faced similar issues, and if so, what ...

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.